hi,.. i know this question is too lengthy... but pls bear with me...
i need to compare 2 files and print the diff in another file... the 2 files look like these....
file 1 file 2
xyz_20021204_0000.txt xyz_20021204_0100.txt
xyz_20021204_0015.txt xyz_20021204_0115.txt
xyz_20021204_0030.txt xyz_20021204_0130.txt
xyz_20021204_0045.txt xyz_20021204_0145.txt
xyz_20021204_0100.txt xyz_20021204_0200.txt
xyz_20021204_0115.txt xyz_20021204_0000.txt
xyz_20021204_0130.txt xyz_20021204_0015.txt
xyz_20021204_0145.txt xyz_20021204_0030.txt
xyz_20021204_0200.txt xyz_20021204_0045.txt
xyz_20021204_0215.txt
for getting the diff, I use sdiff like this...
sdiff -s ./file1 ./file2 | awk -F_ '{if ($1 ~ /xyz/) print $0}' | awk '{print "get " $1}' > ./tmp4
so the output i expect is like this
get xyz_20021204_0215_Q.txt
'coz this is the only diff between the 2 files.. but i'm getting something like this,
get xyz_20021204_0000_Q.txt
get xyz_20021204_0015_Q.txt
get xyz_20021204_0030_Q.txt
get xyz_20021204_0045_Q.txt
get >
get >
get >
get >
get >
can u pls help me out in this... ur help appreciated....
thx in advance...
i need to compare 2 files and print the diff in another file... the 2 files look like these....
file 1 file 2
xyz_20021204_0000.txt xyz_20021204_0100.txt
xyz_20021204_0015.txt xyz_20021204_0115.txt
xyz_20021204_0030.txt xyz_20021204_0130.txt
xyz_20021204_0045.txt xyz_20021204_0145.txt
xyz_20021204_0100.txt xyz_20021204_0200.txt
xyz_20021204_0115.txt xyz_20021204_0000.txt
xyz_20021204_0130.txt xyz_20021204_0015.txt
xyz_20021204_0145.txt xyz_20021204_0030.txt
xyz_20021204_0200.txt xyz_20021204_0045.txt
xyz_20021204_0215.txt
for getting the diff, I use sdiff like this...
sdiff -s ./file1 ./file2 | awk -F_ '{if ($1 ~ /xyz/) print $0}' | awk '{print "get " $1}' > ./tmp4
so the output i expect is like this
get xyz_20021204_0215_Q.txt
'coz this is the only diff between the 2 files.. but i'm getting something like this,
get xyz_20021204_0000_Q.txt
get xyz_20021204_0015_Q.txt
get xyz_20021204_0030_Q.txt
get xyz_20021204_0045_Q.txt
get >
get >
get >
get >
get >
can u pls help me out in this... ur help appreciated....
thx in advance...