while read line1
do
temp1=$(echo $line1 | awk '{print substr($1,1,3)}')
while read line2
do
temp2=$(echo $line2 | awk '{print substr($1,1,3)}')
[ $temp1 == $temp2 ] && echo $line2 $line1 >> c.txt
done < a.txt
done < b.txt
exit 0
這樣做大概可以解決
但是效率很差
而且當我資料很多筆時
不知道為什麼只做完其中一筆就卡住了
line1 跟 line2 太長還會被換到下一行
--
--
All Comments