Skip to content

Instantly share code, notes, and snippets.

@NeilRobbins
Last active December 19, 2015 05:19
Show Gist options
  • Save NeilRobbins/5903147 to your computer and use it in GitHub Desktop.
Save NeilRobbins/5903147 to your computer and use it in GitHub Desktop.
Take a file and make a csv from each line, trimming each line for excess whitespace, and placing its contents into double quotes. Use the uniq utility to remove any duplicate lines.
awk '{gsub (/^[ \t]+|[ \t]+$/,""); print "\"" $0 "\"," > "OUTPUT.csv" }' INPUT.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment