awk question

P.U.Kruppa ulrich at
Thu Jul 26 20:22:16 UTC 2007

Hi (and sorry for this slightly OT question),

I would like to extract the second last field of each line of a 
file called user.csv .
So I try
 	> awk '{print $(NF-1)}' user.csv
 	awk: trying to access out of range field -1
  	input record number 1, file user.csv
  	source line number 1

Obviously $(NF-1) doesn't do the trick. Any better idea?



Peter Ulrich Kruppa

More information about the freebsd-questions mailing list