regex - Skip lines whose 2nd column has a string -


my cvs file has 10 columns , want rid of lines 2nd field ($2) has string beginning "synonymous". tried this:

awk '$2 ~ /^synonymous/ {next}' 

but not print out anything.

you need tell awk want do. far you've told skip records 2nd field starts "synonymous" haven't told awk @ rest of them. try instead:

awk '$2 !~ /^synonymous/' 

that says "if 2nd field doesn't start synonymous, invoke default action of printing record".


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -