Hi,
I've written the following code to compare 2 csvs,
awk 'NR==FNR{_[NR]=$0}
NR!=FNR{
if($0 != _[FNR])
{
print $0
}
}' export1.csv export2.csv
But I need to extend it (as it really only offers diff capabilities) to compare based on some unique ID e.g. userid.
File 1
userid, fname, sname, dob, license number
1, diar, cart, 12/12/12, 13324
17, mickey, mouse, 2/2/22, 22222
14, donald1, duck, 1/1/11, 11111
File 2
userid, fname, sname, dob, license number
1, diar, cart, 12/12/12, 1332x
22, tom, thumb, 4/4/44, 44444
14, donald1, duck, 1/1/11, 11111
17, mickey, mouse, 2/2/22, 22222
I've written the following code to compare 2 csvs,
awk 'NR==FNR{_[NR]=$0}
NR!=FNR{
if($0 != _[FNR])
{
print $0
}
}' export1.csv export2.csv
But I need to extend it (as it really only offers diff capabilities) to compare based on some unique ID e.g. userid.
File 1
userid, fname, sname, dob, license number
1, diar, cart, 12/12/12, 13324
17, mickey, mouse, 2/2/22, 22222
14, donald1, duck, 1/1/11, 11111
File 2
userid, fname, sname, dob, license number
1, diar, cart, 12/12/12, 1332x
22, tom, thumb, 4/4/44, 44444
14, donald1, duck, 1/1/11, 11111
17, mickey, mouse, 2/2/22, 22222