
15 Jun
2007
15 Jun
'07
10:31 p.m.
Sebastian Sylvan wrote:
On 15/06/07, Jim Burton
wrote: [snip] Hi, Hi Sebastian, I haven't compiled this, but you get the general idea: import qualified Data.ByteString.Lazy.Char8 as B -- takes a bytestring representing the file, concats the lines -- then splits it up into "real" lines using the delimiter clean :: Char -> B.ByteString -> [B.ByteString] clean' d = B.split d . B.concat . B.lines
I think that would only work if there was one column per line...I didn't make it clear that as well as being comma separated, the delimiter is around each column, of which there are several on a line so if the delimiter is ~ a file might look like: ~sdlkfj~, ~dsdkjf~ #eo row1 ~sdf dfkj~, ~dfsd~ #eo row 2