[PLUG] awk: next statement not working as intended

Rich Shepard rshepard at appl-ecosys.com
Mon Jul 2 22:04:00 UTC 2012


   In a data file I have rows like this:

'D-1'|'2007-12-12'|0|'Hg'||0||

where the 4th field is blank. I want to drop these rows from the output.

   The awk script begins like this:

#! /usr/bin/gawk -f

BEGIN { FS = "|"; OFS = "|" }

# If no quantity, drop row
$4 ~ /""/ { next }

   yet these rows are not dropped. My reading of the next statement in
'Effective awk Programming' and in examples Google found for me suggest that
the above syntax should work. Can someone point out what I missed?

Rich




More information about the PLUG mailing list