News for hackers. Stuff that matters.
Re:Working with CSV files on shell/terminal by midasuni on Wednesday June 28, 2023 @03:56AM (#36503623)
I think “most” is pulling a lot of work there. I make and process csvs a lot, and just avoid quotes when generating them.

Sure technically you can do things like having new lines on a line which cause all sorts of grief, but if you control the end to end workflow just avoid it.

I have a tool which monitors performance of loading various websites via various proxies at various points ok our network with pupetteer. That outputs a csv which I can then extract data from and make handy graphs to show manglement.

Re:Working with CSV files on shell/terminal by benhoyt on Wednesday June 28, 2023 @04:31AM (#36503834)
> avoid quotes when generating them

Yeah, I guess that kinda works if you're the one generating them. But you must not have too many strings -- like a name field containing "Smith, John" or a book title like "The Lion, the Witch and the Wardrobe"? When I deal with CSV's those kind of things are quote common. I actually prefer TSV because you can (more easily) process them with standard AWK.

Re:Working with CSV files on shell/terminal by midasuni on Friday June 30, 2023 @04:04AM (#36531903)
Deal with ip addresses and numbers, maybe host names, and csvs are perfect to process
Re:Working with CSV files on shell/terminal by meepmorp on Wednesday June 28, 2023 @04:11AM (#36503724)
Quotes aren't the problem, it's having an in-band separator character. Maybe you're lucky enough to only need naive splitting on commas, but lots of us need to jam in human-produced text stings where the punctuation needs to be preserved without breaking file parsing.