awk sorting according one colum but must be printed all of them -



awk sorting according one colum but must be printed all of them -

i can find way may open mind

awk '{$3=cet print $0 }' < sort < awk '{cet=$3 }' file.txt

input

1 00a0asd4426 18/10/2014 09:08:50 2 00a0bsdfsdf no info found 3 0asdasdsda3 25/10/2014 10:31:53

output

1 00a0asd4426 18/10/2014 09:08:50 3 0asdasdsda3 25/10/2014 10:31:53 2 00a0bsdfsdf no info found

the canonical approach using sort -k :

$ cat l d 1 b c 2 c b 3

test :

$ sort -k2 l c b 3 b c 2 d 1

use -n switch if treat numbers , -t del whete del own delimiter (space default)

sorting awk

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -