On 13 Jun 13:57, Chris Walker wrote:
On 13/06/11 12:54, Brett Parker wrote:
On 13 Jun 12:35, Ted Harding wrote:
On 13-Jun-11 11:02:16, Brett Parker wrote:
I would *never* suggest parsing csv in bash. Ever. Python's csv module is lovely, and perl's DBD::CSV is fine. Awk hasn't got a csv parser,
Err, I respectfully disagree ... (in other words, b*****ks)!
[snip]
I respectfully call you a fucking moron and ask you what happens if your csv does something like:
People, please. I'm glad I started this now!
Well, you know, I take exception to people telling me "b*****ks" and give an example that fails on a trivial dataset...
on commas is no longer funny. And when people turn up on a list with a lot of technical people on it suggesting doing just this it makes me Very Angry. And you don't want to see me angry.
Do you turn green? ;-)
I always preferred TSV or fixed width data rather than CSV because of the possibility of the data containing commas. Mine does here.
Same problem, content can contain tabs... this is why the CSV spec ain't small, and actually covers many different delimeters, and what to do with them...
And as you've just proven my point (the content does contain commas...) I think it was a justified response :)
I'm away from the keyboard this afternoon and when I return I'll be looking at the website that Richard mentioned.
While I'm away, can you play nicely please?
I always play nice. It just might not seem that way occasionally... I'm saving hours of debugging and trying to work out "why did that break like that?" when given a non-trivial dataset.