as friends can only Sort this file with awk from low to high from position 3 to 9 bone this:
0003344
A70003344prueba1
A70003347prueba1
A70003345prueba1
A70003349prueba1
A70003343prueba1
A70003342prueba1
as friends can only Sort this file with awk from low to high from position 3 to 9 bone this:
0003344
A70003344prueba1
A70003347prueba1
A70003345prueba1
A70003349prueba1
A70003343prueba1
A70003342prueba1
Doesn't AIX sort offer the -k, --key=F[.C][,F[.C]][OPTS]
option?
sort -k1.3,1.9n file
A70003342prueba1
A70003343prueba1
A70003344prueba1
A70003345prueba1
A70003347prueba1
A70003349prueba1
thank you...
In fact, with leading zeroes and fixed field length as in this example, the n
option (numeric sort) is not mandatory. It's used more in cases where fields are varying length and/or space padded and values stretch over several orders of magnitude.
thanks for the advice, I have the advantage that they are fixed positions