Skip to content

Instantly share code, notes, and snippets.

@sp00nman
Created April 10, 2014 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sp00nman/10373325 to your computer and use it in GitHub Desktop.
Save sp00nman/10373325 to your computer and use it in GitHub Desktop.
Merge different files by column with awk
awk -F"\t" 'NR==FNR {f1[$2]=$0;next}($4 in f1){print $0"\t"f1[$4]}' file1 file2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment