Hii Friends.. I have a huge set of data stored in a file.Which is as shown below
a.dat:
HTML Code:
RAO 1869 12 19 0 0 0.00 17.9000 82.3000 10.0 0 0.00 0 3.70 0.00 0.00 0 0.00 3.70 4 NULL
LEE 1870 4 11 1 0 0.00 30.0000 99.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 6.75 6.75 9 NULL
SIG 1870 4 11 1 0 0.00 30.0000 99.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 0.00 6.75 9 NULL
SIG 1870 4 11 1 0 0.00 30.0000 99.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 6.70 6.70 0 NULL
RAO 1870 10 19 0 0 0.00 17.7000 83.4000 10.0 0 0.00 0 3.70 0.00 0.00 0 0.00 3.70 4 NULL
SSR 1896 3 4 5 5 0.00 37.0000 76.0000 40.0 0 0.00 0 7.10 0.00 0.00 0 0.00 7.10 8 NULL
SSR 1896 6 17 12 0 0.00 37.0000 68.0000 15.0 0 0.00 0 5.20 0.00 0.00 0 0.00 5.20 7 2.23e+23
SIG 1899 9 23 23 24 0.00 37.0000 71.0000 160.0 0 0.00 0 0.00 0.00 0.00 0 7.50 7.50 6 NULL
SSR 1899 9 23 23 20 0.00 37.0000 71.0000 160.0 0 0.00 0 7.50 0.00 0.00 0 0.00 7.50 6 NULL
SIG 1902 8 30 21 50 0.00 37.0000 71.0000 200.0 0 0.00 0 0.00 0.00 0.00 0 7.70 7.70 7 NULL
SSR 1902 8 30 21 50 0.00 37.0000 71.0000 200.0 0 0.00 0 7.70 0.00 6.90 0 0.00 7.70 7 NULL
BDA 1905 4 4 2 50 0.00 33.0000 76.0000 60.0 0 0.00 0 5.00 8.00 0.00 0 8.60 8.60 0 NULL
G-R 1905 4 4 0 50 0.00 33.0000 76.0000 25.0 0 0.00 0 5.00 8.00 0.00 0 8.60 8.60 0 1.23e+11
SIG 1905 4 4 2 50 0.00 33.0000 76.0000 25.0 0 0.00 0 0.00 0.00 0.00 0 8.60 8.60 0 NULL
SIG 1950 8 15 0 0 0.00 28.5000 96.7000 0.0 0 0.00 0 0.00 0.00 0.00 0 8.60 8.60 0 NULL
BDA 1950 8 15 14 9 30.00 28.5000 96.5000 60.0 0 0.00 0 0.00 0.00 0.00 0 8.70 8.70 0 NULL
G-R 1913 3 6 2 9 0.00 30.0000 83.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 6.20 6.20 0 NULL
Output for this file should be like b.dat:
HTML Code:
RAO 1869 12 19 0 0 0.00 17.9000 82.3000 10.0 0 0.00 0 3.70 0.00 0.00 0 0.00 3.70 4 NULL
LEE 1870 4 11 1 0 0.00 30.0000 99.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 6.75 6.75 9 NULL
RAO 1870 10 19 0 0 0.00 17.7000 83.4000 10.0 0 0.00 0 3.70 0.00 0.00 0 0.00 3.70 4 NULL
SSR 1896 3 4 5 5 0.00 37.0000 76.0000 40.0 0 0.00 0 7.10 0.00 0.00 0 0.00 7.10 8 NULL
SSR 1896 6 17 12 0 0.00 37.0000 68.0000 15.0 0 0.00 0 5.20 0.00 0.00 0 0.00 5.20 7 NULL
SIG 1899 9 23 23 24 0.00 37.0000 71.0000 160.0 0 0.00 0 0.00 0.00 0.00 0 7.50 7.50 6 NULL
SSR 1902 8 30 21 50 0.00 37.0000 71.0000 200.0 0 0.00 0 7.70 0.00 6.90 0 0.00 7.70 7 NULL
BDA 1905 4 4 2 50 0.00 33.0000 76.0000 60.0 0 0.00 0 5.00 8.00 0.00 0 8.60 8.60 0 NULL
BDA 1950 8 15 14 9 30.00 28.5000 96.5000 60.0 0 0.00 0 0.00 0.00 0.00 0 8.70 8.70 0 NULL
G-R 1913 3 6 2 9 0.00 30.0000 83.0000 0.0 0 0.00 0 0.00 0.00 0.00 0 6.20 6.20 0 NULL
Now in this file i have to remove duplicates lines based these conditions.
We check for column 19
1)if its value is between 0 to 7.00.Then
we check for 2,3,4,5,6 columns if they are same if so then remove one of the duplicate rows & retain the row which has its largest value in column 19 & Which has large set of columns with values in that row. and
2)If its value is between 7.00 to 8.00. Then
we check for 2,3,4,5 columns if they are same if so then remove one of the duplicate rows & retain the row which has its largest value in column 19 & Which has large set of columns with values in that row. and
3)if its value is between 8.00 to 9.00. Then
we check for 2,3,4 columns if they are same if so then remove one of the duplicate rows & retain the row which has its largest value in column 19 & Which has large set of columns with values in that row.
Help me out