Have you ever needed to display cat content of two files side by side on terminal, if yes you are right place :)
You have following options :
1. Vimdiff :
Edit two, three or four versions of a file with Vim and show differences, just play with 'man vimdiff' for more options.
Eg : vimdiff file1 file2
2. Paste :
Merge lines of files, go for 'man paste' for more options.
Eg : paste file1 file2
3. Pr :
Convert text files for printing, do 'man pr' for more detail.
Eg : pr -m -t -W 100 brl gndcfile
4. sdiff :
side-by-side merge of file differences, do 'man sdiff' for more detail
Eg: sdiff file1 file2
5. Using awk command:
Eg:
awk 'BEGIN{print "Column1\tColumn2"} {getline a < "file2";printf "%-40s\t%s\n",$0,a}' file1
You have following options :
1. Vimdiff :
Edit two, three or four versions of a file with Vim and show differences, just play with 'man vimdiff' for more options.
Eg : vimdiff file1 file2
2. Paste :
Merge lines of files, go for 'man paste' for more options.
Eg : paste file1 file2
3. Pr :
Convert text files for printing, do 'man pr' for more detail.
Eg : pr -m -t -W 100 brl gndcfile
- -m, --merge
- -t, --omit-header
- -w, --width=PAGE_WIDTH
4. sdiff :
side-by-side merge of file differences, do 'man sdiff' for more detail
Eg: sdiff file1 file2
5. Using awk command:
Eg:
awk 'BEGIN{print "Column1\tColumn2"} {getline a < "file2";printf "%-40s\t%s\n",$0,a}' file1
No comments:
Post a Comment
Thank you for Commenting Will reply soon ......