Skip to content

Instantly share code, notes, and snippets.

@mneedham
Created January 16, 2011 14:19
Show Gist options
  • Select an option

  • Save mneedham/781819 to your computer and use it in GitHub Desktop.

Select an option

Save mneedham/781819 to your computer and use it in GitHub Desktop.
column_1 column_2
mark random
mark something_else
dave
Only care about column_1 uniqueness but want to print out column 2 in the result
Output
1 dave
2 mark random
@abhishekkr
Copy link
Copy Markdown

awk '{ if(!unq[$1]) print $2; unq[$1]=$1; }' file.name

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment