scripting help
From: David Sharples (david.sharples3@ntlworld.com)
Date: 04/08/03
- Next message: Thomas Rösner: "newfs"
- Previous message: Jens.Toerring@physik.fu-berlin.de: "Re: Where to start in unix/matlab error message?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "David Sharples" <david.sharples3@ntlworld.com> Date: Tue, 8 Apr 2003 21:48:21 +0100
Hi, I have this one line which pull field 32 and 170 out of a csv file and
then awks through them to keep the last occurence of field 32.
However sometimes field 32 is blank so I dont want to output that combo to
my new file, can I in the cut part only take fields that actually have a
value in them or how would i do it in the awk part?
Thanks
cut -f 32,170 -d "," s006.txt | awk '{arr[$1]=$0} END{ for(i in arr){print
arr[i]}}' > dave.txt.
Also is the awk part 'efficient' can I speed it up anyway?
- Next message: Thomas Rösner: "newfs"
- Previous message: Jens.Toerring@physik.fu-berlin.de: "Re: Where to start in unix/matlab error message?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|