On 6/15/07, Jim Burton <[EMAIL PROTECTED]> wrote:
Sebastian Sylvan wrote:
> On 15/06/07, Jim Burton <[EMAIL PROTECTED]> 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

I love to see people using Haskell, especially professionally, but I
have to wonder if the real tool for this job is sed? :-)

Jason
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to