2
I have a file that has three columns, and several rows. The second column is composed of numerical values, and I want to reorganize it, in ascending order, but without affecting the previous column and the subsequent one.
exemplo do arquivo:
7.31937 736 /tmp/ref13
7.3223 5373 /tmp/ref13
7.32816 768 /tmp/ref13
7.32955 5370 /tmp/ref10
o que eu quero:
7.31937 736 /tmp/ref13
7.3223 768 /tmp/ref13
7.32816 5370 /tmp/ref13
7.32955 5373 /tmp/ref10
I tried to sort -k2 -n
, but this command is moving the other columns =(
Will someone help me? Thanks!
Edit:
[Resolvido]Comando utilizado:
`paste -d' ' <(awk '{print $1}' nome_arquivo) <(awk '{print $2}' nome_arquivo | sort -n) <(awk '{print $3}' nome_arquivo)`
Make a tour by stackoverflow, learn a little about the rules and good practices. Then edit your question and enter the code of what you’ve tried...
– Marco Giovanni
Yes, it’s a good question now.. It’s clearer and easier to understand
– Marco Giovanni