- 39 名前:デフォルトの名無しさん mailto:sage [04/02/10 00:44]
- >>1ではないのだが・・・
続き getCsvData :: Int [Char] -> [Char] getCsvData num [x:xs] = getCsvData` num [x:xs] where getCsvData` n [x:xs] | x == '\n' = ['\n'] ++ getCsvData` num xs | x == ',' = getCsvData` (n-1) xs | n == 0 = [x] ++ getCsvData` n xs | otherwise = getCsvData` n xs // getCsvData` 0 [x:xs] = [x] ++ getCsvData` 0 xs getCsvData` n [] = [] CharListWrite [] f = f CharListWrite [c:cs] f = CharListWrite cs (fwritec c f) CharFileCopy infile outfile = CharListWrite (CharListRead infile) outfile CharListRead f | not readok = [] | otherwise = [char : CharListRead filepointer] where (readok,char,filepointer) = sfreadc f エラー処理は考えてません。 >>37はインデントがずれているので、適当に脳内補完しといてくれ。
|

|