I have a big file having 50s columns and 100K of rows delimited by |
. Now $2
(col 2) has multiple type of $1
(col 1) value which means col 2 will be repeated. So I have sorted the file.
I need now to extract/filter the result file on the basis of below condition:
- condition 1 : when
$2
has both type of$1
(value of$1
for$2
is more than 8000 as well as less than 8000) then select the complete row which is for$1
< 8000 for the given$2
- condition 2: if
$2
has only$1 > 8000
then select the complete row which is having max$8
value
E.g: source file
4000|1234||||||23
5000|1234||||||22
9000|1234||||||25
10000|123|||||||22
22000|456|||||||27
15000|456|||||||29
result file would have:
9000|1234||||||25
10000|123|||||||23
15000|456|||||||29
Can anyone please advice on this ? Thanks in advance