Hi,
I have the following two files:
test1.txt:
syxe weq eww
cxa 322 342
wq1 234 edd
343 dss sds
and test2.txt
syxe weq eww
cxa 322 342
wq1 234 edd
341 dss sds
syx weq eww
cx2 322 342
wq3 234 edd
347 dss sds
and I used the following program to extract the lines which are in test2.txt and not in test1.txt:
awk '
BEGIN{
while((getline<"test2.txt")>0){
a[$1]=$1;b[$1]=$0
}
}
{
if ($1!=a[$1]) printf "%s\n",b[$1]
}
' test1.txt
Using this script, does not produce any output..
Can anybody help what is wrong in this script.
Thanks in advance
I have the following two files:
test1.txt:
syxe weq eww
cxa 322 342
wq1 234 edd
343 dss sds
and test2.txt
syxe weq eww
cxa 322 342
wq1 234 edd
341 dss sds
syx weq eww
cx2 322 342
wq3 234 edd
347 dss sds
and I used the following program to extract the lines which are in test2.txt and not in test1.txt:
awk '
BEGIN{
while((getline<"test2.txt")>0){
a[$1]=$1;b[$1]=$0
}
}
{
if ($1!=a[$1]) printf "%s\n",b[$1]
}
' test1.txt
Using this script, does not produce any output..
Can anybody help what is wrong in this script.
Thanks in advance