Jörg Schneider said:
EA said:
I'm looking for a command line program that I can use to process CSV
files through a script or batch file. Specifically, I'm looking for
something that can delete fields.
GNU Awk
[...]
Download:
http://prdownloads.sourceforge.net/gnuwin32/gawk-3.1.0-2-bin.zip
The GnuWin32 collection that contains gawk referred to in the url
above can be referenced directly at:
http://sourceforge.net/projects/gnuwin32
gawk is well suited for manipulating fields but you may also be
interested in the other utilities in this collection, as well.
gawk can do anything that the following utilities can do (and more)
but depending on your preference you may be nevertheless be
interested in them:
- The cut utility, found in the textutils bundle there, is specifically
aimed at deleting delimited fields from text files. This one seems
particularly pertinent to your query.
- The tr utility, also in the textutils bundle, is used for translating
or deleting characters. Typical usages might include: translate all
commas to tabs, delete all double quotes or delete all whitespace.
- The sed utility is a stream editor whose capabilities include replacing
text with other text.