File1.txt
Name|City|Age
john|delhi|25
marry|london|45
phill|newyork|26
file2.txt
LA
Amsterdam
Mumbai
我需要用file2.txt的城市替换file1.txt的城市。我是shell脚本的新手。请帮忙。
答案 0 :(得分:0)
$ paste -d"|" <(cut -d"|" -f1 file1.txt) <(echo City; cat file2.txt) <(cut -d"|" -f3- file1.txt)
Name|City|Age
john|LA|25
marry|Amsterdam|45
phill|Mumbai|26