05-21-2004
740,
3
Join Date: Jul 2002
Last Activity: 17 June 2009, 5:17 PM EDT
Location: Atlanta
Posts: 740
Thanks Given: 0
Thanked 3 Times in 2 Posts
It may be easier to keep the fields you want by creating a new file. To do so you can use Awk since the fields are nicely delimited by a comma.
cat yourfile | awk 'BEGIN{OFS="," FS= ","}{print $1, $2, $3, $4, $5, $6} > "/path/to/your/new/file.dat" '
Change $1, $2, .. $6 to be the field position number of the fields you want to keep. So if you wanted to keep fields 1, 24, 46, 48, 54, and 99 then the statement would read
.. {print $1, $24, $46, $48, $54, $99} ..
Last edited by google; 05-21-2004 at 09:22 AM..