Skip to content

Instantly share code, notes, and snippets.

@nanmu42
Created March 11, 2020 04:38
Show Gist options
  • Save nanmu42/cf840bcbef5f9186f015b0c444a88e5f to your computer and use it in GitHub Desktop.
Save nanmu42/cf840bcbef5f9186f015b0c444a88e5f to your computer and use it in GitHub Desktop.
awk examples
# unique line
awk '{!seen[$0]++};END{for(i in seen) if(seen[i]==1)print i}' file
# second column of a csv, with white spaces and quotes stripped
awk -F',' '{gsub(/[ "]/, "", $0);print $2}' some.csv > dest.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment