Hi folks. I have data something like this:
25,AGH,0.2
25,GHT,0.5
25,jsw,1.7
34,TUY,3.0
37,KJU,1.2
37,KJT,1.2
The logic I want to input here is that IF field 1 of lines are same, then isolate the line with the least field 3 value in to a new file.
For example - lines 1,2,3 have same field 1 value i.e. 25. So, now among those three lines, I need to isolate the line that has lowest field 3 value. So, here it is line 1 which has 0.2 in its field 3. I need to put these isolate lines in a seperate file.
If there are two lines with same field 1 and field 3 values, isolate both of them.
My desired out put will be
25,AGH,0.2
34,TUY,3.0
37,KJU,1.2
37,KJT,1.2
I am like a toddler in this field and tried different scripts and each time I embarrassed myself. lol.
I really appreciate any help. TIA
25,AGH,0.2
25,GHT,0.5
25,jsw,1.7
34,TUY,3.0
37,KJU,1.2
37,KJT,1.2
The logic I want to input here is that IF field 1 of lines are same, then isolate the line with the least field 3 value in to a new file.
For example - lines 1,2,3 have same field 1 value i.e. 25. So, now among those three lines, I need to isolate the line that has lowest field 3 value. So, here it is line 1 which has 0.2 in its field 3. I need to put these isolate lines in a seperate file.
If there are two lines with same field 1 and field 3 values, isolate both of them.
My desired out put will be
25,AGH,0.2
34,TUY,3.0
37,KJU,1.2
37,KJT,1.2
I am like a toddler in this field and tried different scripts and each time I embarrassed myself. lol.
I really appreciate any help. TIA