
向各位大佬求助mawk讀取兩個文件的問題文件1.txt內容如下2|更好滬目文件電股份5|大范甘迪格瑞特讓他文件2.txt內容如下Defeat the Prince for the first time.Ward of VarietyComplete the second story act.Ward of VolumeDiscover the second warding spell.Ward of Champions我想通過讀取文件1的第一列作為行號判斷,替換掉文件2中的內容,我是這樣寫的,mawk.exe -F | NR==FNR{a[$1]=$1;b[$1]=$2;next}{if (a[$1]==FNR){print b[$1]} else {print $0}} 1.txt 2.txt > 3.txt但是輸出的文件3與文件2一樣,沒有任何變化,不知道應該怎么寫。我希望輸出的文件3應該是這樣Defeat the Prince for the first time.更好滬目文件電股份Complete the second story act.Ward of Volume大范甘迪格瑞特讓他Ward of Champions

