Posted on 2003-02-21
Is there anyway to sort a textfile by two fields that are delimited by different things?
like the following....
field 1: field 2 (field 3)
Server a: 150 (85)
Server b: 20
Server c: 150 (70)
Server d: 75
I wanted to sort this somehow first by the second field, and then when there is the clash of the second field by the third field (which only exists is there is a field 2 clash)...
problem is i have no idea of how i can handle this situation where i have the : as the delimiter between field 1 and 2 and then the space as delimiter between fields 2 and 3....
PS. sort meaning sorted in numeric order so 20 appears higher up than 150
Many thanks in advance.