Export to CSV - proper format

Jay R. Ashworth jra at baylink.com
Wed Oct 20 14:44:37 PDT 2010


----- Original Message -----
> From: "Bill Campbell" <bill at celestial.com>

> A simple way to change comma-delimited files with "," separating
> records with a modern version of sed would be:
> 
> sed -e 's/","/\t/g' < /tmp/exported_file.txt > /tmp/exported_file.tsv

Alas, that doesn't leverage the *primary* advantage of having your app
do the export properly -- and I prefer '|' as a delimiter myself; it takes
less space on the screen -- which is that *the app knows* which commas *were
already in the data*, and which ones it added as delimiters.

Your external post processing script *cannot even safely guess*.

None of this really probably matters to the the OP, though; he was almost
certainly trying to talk to yet some other app, which may not accept
anything but CSV (of which there are, I think either 4 or 6 'standard' 
versions).

"That's the nice thing about standards... there are so many of them."
  -- John 'gnu at hoptoad' Gilmore

Cheers,
-- jra

-- 
Jay R. Ashworth                   Baylink                      jra at baylink.com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com                     '87 e24
St Petersburg FL USA      http://photo.imageinc.us             +1 727 647 1274

    Start a man a fire, and he'll be warm all night.
     Set a man on fire, and he'll be warm for the rest of his life.


More information about the Filepro-list mailing list