I have several files with some template
ABCD 100 ABCD 200 EFGH 500 IJKL 50 EFGH 700 ABCD 800 IJKL 100
I want to combine the appearance of each (ABCD / EFGH / IJKL) only after sorting based on the highest numbers in column 2
ABCD 800 EFGH 700 IJKL 100
I tried cat *txt | sort -k 1 | cat *txt | sort -k 1 | ??
thanks in advance
My bad, because I'm not explicit. I apologize for wasting your time. Below is a detailed example. The file has several columns. I got the one to use awk and tried this cat * txt | awk '{print $ 3, $ 5}' | sort -gr | no. Now I got strings sorted by numerical value. Now how to get the uniq string for the first match.
<string> <numeral> abcde/efgh/ijkl/mnop -450.00 dfgh/adas/gfda/adasd -100.0 abcde/efgh/ijkl/mnop -100.00 lk/oiojl/ojojl -0.078 dfgh/adas/gfda/adasd 50.0 lk/oiojl/ojojl -0.150 O/p needed abcde/efgh/ijkl/mnop -450.00 dfgh/adas/gfda/adasd -100.0 lk/oiojl/ojojl -0.150
source share