Skip to content

Instantly share code, notes, and snippets.

@sweetmandm
Created September 5, 2012 00:49
Show Gist options
  • Save sweetmandm/3628609 to your computer and use it in GitHub Desktop.
Save sweetmandm/3628609 to your computer and use it in GitHub Desktop.
simple command to merge two files at line breaks using awk.
//Spaces between lines:
awk 'NR==FNR{a[FNR]=$0;next} {print a[FNR],$0}' file1 file2 > file3
//No spaces between lines:
awk 'NR==FNR{a[FNR]=$0;next} {print a[FNR]$0}' file1 file2 > file3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment