EG。档案1
git filter-branch --parent-filter \
'test $GIT_COMMIT = 1234567890123456789012345678901234567890 && \
echo "" || cat' -- --all
文件2
refs/original/
我想比较file1'" GATEWAY_GUID"带有file2< device_gateway_guid列的列。输出应该是file1中看不到的file1的所有记录。
预期产出
"ACCOUNT_ID","CTN","NAME","GATEWAY_GUID","DEVICE_GUID","CATALOG_ID","FW_VERSION","DATE_CREATED","STATUS_ID","LOCATION_CODE","BAN","Market_Area","State","IMEI","HW_MODEL"
"306875",="9404653975","14-052917 14-052917","313A0B72E3E440DD8687BD681E55FB03","0",="000010000010004","FW: 1.04.122, JVM: Oracle Corporation 1.7.0_72-ea, OS: Linux 2.6.33.5","06/24/2014 14:32:38","0",="0003013034",="177046772949","DLS","TX",="351612051721824","Cisco DLC-100"
"306875",="9404653975","14-052917 14-052917","7EED6EE61F0949EE99554D4D4F09E4FE","ACFF000001",="000010901000004","1.2.14","06/24/2014 21:28:17","0",="",="177046772949","DLS","TX",="351612051721824",""
"306875",="9404653975","14-052917 14-052917","D57DAE988A1C482EA3217312EDC7466E ","ACFF010904",="000010907000004","","12/16/2015 23:39:21","0",="",="177046772949","DLS","TX",="351612051721824",""
[因为这可以在file1中看到,但不在file2中看到]
例如:如果文件1有10条记录而文件2有5000条记录。在5000个文件中,5个记录与文件1相同。然后我的输出文件应显示缺少file1中未见的5个列值。
答案 0 :(得分:0)
2个文件之间的不同引用/间距会增加皱纹,但comm
是此处使用的工具,具有正确准备的输入
comm -23 <(awk -F, 'NR > 1 && NF {gsub(/^"|"$/,"",$4);print $4}' file1 | sort) \
<(awk -F, 'NR > 1 && NF {gsub(/^ | $/,"",$6);print $6}' file2 | sort)
D57DAE988A1C482EA3217312EDC7466E
-23
选项会丢弃共同的行(-3)和file2(-2)唯一的行,这些字段对于file1是唯一的。