Hi,
I need help in transforming a text file. Here is an example of file1.txt:
Please help me check if the 1st, 2nd and 3rd argument is the same, delete the line where the 4th and 5th argument is lower, also if the 4th and 5th argument is same or equal, delete one line. file1.txt should look like this:
I only got this code as a start:
awk '/TABLE|VWW|MCR/ {print ; next; }' file1.txt > file2.txt
But I do not know how to proceed and go about comparing the values. Thank you in advance for you help.
I need help in transforming a text file. Here is an example of file1.txt:
Code:
pos1 TABLE ah_feed 3828 48
pos1 TABLE ah_feed 7402 103
po1 VWW ah_feed 1234 123
po1 VWW ah_feed 1234 123
pos2 TABLE DEPT_XREF 6365942 181866
pos2 TABLE DEPT_XREF 12758867 364521
pos2 VWW dep_f 122 2
pos2 TABLE dept_xref_bkup 123 11
pos2 TABLE dept_xref_bkup 128 12
pos2 TABLE dfso_pos_tr 12694 24
pos2 TABLE dfso_pos_tr 20278 40
pos2 TABLE div_rpt 504 0
pos2 TABLE div_rpt 553 1
pos2 MCR pos_f 123 0
Please help me check if the 1st, 2nd and 3rd argument is the same, delete the line where the 4th and 5th argument is lower, also if the 4th and 5th argument is same or equal, delete one line. file1.txt should look like this:
Code:
pos1 TABLE ah_feed 7402 103
po1 VWW ah_feed 1234 123
pos2 TABLE DEPT_XREF 12758867 364521
pos2 VWW dep_f 122 2
pos2 TABLE dept_xref_bkup 128 12
pos2 TABLE dfso_pos_tr 20278 40
pos2 TABLE div_rpt 553 1
pos2 MCR pos_f 123 0
I only got this code as a start:
awk '/TABLE|VWW|MCR/ {print ; next; }' file1.txt > file2.txt
But I do not know how to proceed and go about comparing the values. Thank you in advance for you help.