I need help with a script to compare two files. I know the
command "diff" but I think it needs to be a bit more complex
to do what I want.
I have two files. They are in the same directory. They both have
similiar text in them.
1st File: file1
2nd File: file2
The newest file is file1 and has text like:
VA1419A 671 631 1622 151 43 360
VA1439A 537 481 1139 111 10 360
VA1433A 1160 1157 3703 412 10 360
VA1373B 338 323 978 82 10 360
VA0345B 948 947 4136 324 10 360
VA0337B 1821 1815 8802 811 41 360
The second file2 has text like:
VA1419A 671 631 1622 151 12 360
VA1437A 537 481 1139 111 10 360
VA0015A 1160 1157 3703 412 10 360
VA1900B 338 323 978 82 10 360
VA0343B 948 947 4136 324 10 360
VA0337B 1821 1815 8802 811 10 360
I need a small script to look for matching text in column 1 of each file.
File1 should be matched against file2 since it is the newest.
If it finds a match, then it needs to look at field 6 of both files for
the matching text.
If the number in field 6 of file1 is greater than 30 or more in field 6
of file2, I need it to send field 1 and 6 of file1 to > final_drops.txt
So by comparing the two examples above it would find and send the below
text to the file final_drops.txt
VA1419A 43
VA0337B 41
As a side note, the column 1 of each file may not have the same text always
like VA or otherwise.
Thanks for any assistance as always!
Beaster
command "diff" but I think it needs to be a bit more complex
to do what I want.
I have two files. They are in the same directory. They both have
similiar text in them.
1st File: file1
2nd File: file2
The newest file is file1 and has text like:
VA1419A 671 631 1622 151 43 360
VA1439A 537 481 1139 111 10 360
VA1433A 1160 1157 3703 412 10 360
VA1373B 338 323 978 82 10 360
VA0345B 948 947 4136 324 10 360
VA0337B 1821 1815 8802 811 41 360
The second file2 has text like:
VA1419A 671 631 1622 151 12 360
VA1437A 537 481 1139 111 10 360
VA0015A 1160 1157 3703 412 10 360
VA1900B 338 323 978 82 10 360
VA0343B 948 947 4136 324 10 360
VA0337B 1821 1815 8802 811 10 360
I need a small script to look for matching text in column 1 of each file.
File1 should be matched against file2 since it is the newest.
If it finds a match, then it needs to look at field 6 of both files for
the matching text.
If the number in field 6 of file1 is greater than 30 or more in field 6
of file2, I need it to send field 1 and 6 of file1 to > final_drops.txt
So by comparing the two examples above it would find and send the below
text to the file final_drops.txt
VA1419A 43
VA0337B 41
As a side note, the column 1 of each file may not have the same text always
like VA or otherwise.
Thanks for any assistance as always!
Beaster