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

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -