Skip to content

Instantly share code, notes, and snippets.

@blip-lorist
Created December 20, 2016 19:47
Show Gist options
  • Save blip-lorist/69607af25e081fa5fb5d44c813fc79d3 to your computer and use it in GitHub Desktop.
Save blip-lorist/69607af25e081fa5fb5d44c813fc79d3 to your computer and use it in GitHub Desktop.
Awk - Print line and match count if matches more than once
cat input.csv | awk '{print $0,gsub(/PATTERN/,"")}'| awk ' $NF > 1 {print $0}' > output.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment