[mdlug] csv files

Aaron Kulkis akulkis00 at gmail.com
Tue Dec 8 02:37:37 EST 2009


Carl T. Miller wrote:
> This is the first time I've needed to create new csv files
> based on data in existing csv files.  Normally I would just
> start using sed or awk and just start scripting.  However,
> commas and quotes are used as separators, and they can
> also be included in the data.  Ouch.  So much for simple
> parsing.
> 
> Are there any good command line tools to work with csv files?
> 

AT&T developed some commands for doing this decades ago.

man cut			
   look at the flag to set the field separator to ','

man paste
   joins files line by line

for example

$ cat > file1
line1file1
line2file1
line2file1
^D
$ cat > file2
line1file2
line2file2
^D
$paste file1 file2
line1file1 line1file2
line2file1 line2file2
line3file1



> c

> 
> 
> _______________________________________________
> mdlug mailing list
> mdlug at mdlug.org
> http://mdlug.org/mailman/listinfo/mdlug




More information about the mdlug mailing list