CSV command line editing

  • Thread starter Thread starter EA
  • Start date Start date
E

EA

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.
 
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.
 
The GnuWin32 collection... contains gawk... cut utility,... tr utility,... sed utility...
It does indeed. The unxutils package is a small package of popular GNU
utilities available from the same location. It contains all those and
more in a single zip file, which makes it nice way to get started.
http://unxutils.sourceforge.net/
Documentation is not included in this package, but can be downloaded
separately from the "man pages" link near the bottom of that page.
 
Back
Top