1.csv:
rundeck-read-only-iam-permissions,IAMReadOnlyAccess
citrix-xendesktop-ec2-provisioning",AmazonEC2FullAccess
2.csv:
citrix-xendesktop-ec2-provisioning",AmazonEC2FullAAA
citrix-xendesktop-ec2-provisioning",AmazonS3FullAccess
rundeck-read-only-iam-permissions,IAMReadOnlyAccess
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq,qqqqqqqqqqqqqqqq
注意顺序不一样
我想比较文件 2.csv 与文件 1.csv 中的差异(以及 2.csv 中的订单行以匹配 1.csv 中的订单
如果没有更改打印:如果文件 1.csv 中的行发生更改,则没有更改 print 已更改的行 + 行内容,如果文件 1.csv 中的行丢失 print "已删除的行 + 行内容,如果行添加了文件 1.csv 打印“添加了行”+ 行内容,到目前为止,我有这个,它打印所需的输出,但是否可以检测到添加/删除的内容
comm -1 -3 <(sort 1.csv) <(sort 2.csv)
citrix-xendesktop-ec2-provisioning",AmazonEC2FullAAA
citrix-xendesktop-ec2-provisioning",AmazonS3FullAccess
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq,qqqqqqqqqqqqqqqq
diff
可能是您想要的工具。以下是三个示例文件: