存在file1.txt,其内容如下: H aa 0 0 1 -9 H bb 0 0 2 -9 H cc 0 0 2 -9 存在file2.txt,其内容如下: H aa 0 0 0 -9 asd qwe H bb 0 0 0 -9 fgh rty H cc 0 0 0 -9 jkl uio 现希望根据file1和file2相同的列字符合并文件,要求如下:1.如果两个文件的第二列相同,则将file2的第三列.第四列.第五列.第六列修改为file1对应的第三列.第四列.第五列.第六列内容:2.新文件
比较文件夹diff,可以直接使用diff命令 [root@~]# diff -urNa dir1 dir2 -a Treat all files as text and compare them line-by-line, even if they do not seem to be text. -N, --new-file In directory comparison, if a file is found in only one directory, treat it as present