Convertion of specific parts in a txt file
Hello, I am working on Linux and i have a txt file which comprises these lines:
1 Q0 /home/nikol123/Downloads/metadata/12/119317.xml 1 -6.23956 indri
1 Q0 /home/nikol123/Downloads/metadata/20/194709.xml 2 -6.47239 indri
1 Q0 /home/nikol123/Downloads/metadata/13/120365.xml 3 -6.73307 indri
2 Q0 /home/nikol123/Downloads/metadata/25/241886.xml 2 -6.53499 indri
2 Q0 /home/nikol123/Downloads/metadata/18/175920.xml 3 -6.65065 indri........
I want to convert it in order to take:
1 Q0 119317 1 -6.23956 indri
1 Q0 194709 2 -6.47239 indri
1 Q0 120365 3 -6.73307 indri
2 Q0 241886 2 -6.53499 indri
2 Q0 175920 3 -6.65065 indri
I tried the awk command like this:
awk -F'[/ / / / / / . ]' '{print $1 " " $2 " " $9 " " $11 " " $12$13 " " $15}
but i get this result for the 1st line for example: 1 Q0 119317 1 -623956
So i wonder where is the decimal point in -623956?It should be -6.23956 . And where is the word indri? Can you propose me a different syntax for the awk command?
|