Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Message from discussion How would you replace a field in a CSV file?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Goerzen  
View profile  
 More options Oct 9 2006, 11:13 pm
Newsgroups: fa.haskell
From: John Goerzen <jgoer...@complete.org>
Date: Tue, 10 Oct 2006 03:13:42 UTC
Local: Mon, Oct 9 2006 11:13 pm
Subject: [Haskell-cafe] Re: How would you replace a field in a CSV file?
On 2006-10-01, Pete Kazmier <pete-expires-20060...@kazmier.com> wrote:

> For those that know python, here is a very simple implementation that
> happens to be very fast compared to my Haskell version and very short:

>     for line in sys.stdin:
>         fields = line.split(',')

Of course, this doesn't handle quoted values that contain commas, which
are among the many joys* of parsing CSV files.

I might just point out the existance of MissingH.Str.CSV to you, which
can read and write CSV files.  See
http://gopher.quux.org:70/devel/missingh/html/MissingH-Str-CSV.html for
details.

A one-line call gives you a [[String]].

This uses Parsec, so it will not be a top-notch performer, but it is
elegant ;-)

* I mean "joy" sarcastically, in case it wasn't obvious.

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


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.