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

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -