Created
September 5, 2012 00:49
-
-
Save sweetmandm/3628609 to your computer and use it in GitHub Desktop.
simple command to merge two files at line breaks using awk.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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