我在比较两个文件时遇到了问题,我使用以下命令进行比较:
diff file1.csv file2.csv >> outputfile.csv
一切都正常,问题是,如果其中有一行缺失,我的ID开始不同/不再相同,所有内容都被移位,所以diff返回移位后的每一行。如何解决此问题?示例:
diff
6qfn3psc1#
Skip the ID column when doing the comparison. You can use process substitution for this.
diff <(cut -d, -f2- file1.csv) <(cut -d, -f2- file2.csv)
1条答案
按热度按时间6qfn3psc1#
Skip the ID column when doing the comparison. You can use process substitution for this.