How to switch columns 5 and 6 in a file in Linux?
I data samples as follows:
R950E03 111006 930226 910008 Resistant 1
R950E06 110917 950085 910043 Resistant 2
R950C09 110892 950085 910125 Resistant 2
R949B05 111101 870141 840409 Resistant 2
How to switch columns 5 and 6 in a file in Linux?
I data samples as follows:
R950E03 111006 930226 910008 Resistant 1
R950E06 110917 950085 910043 Resistant 2
R950C09 110892 950085 910125 Resistant 2
R949B05 111101 870141 840409 Resistant 2
You can use awk.
awk '{print $1, $2, $3, $4, $6, $5}' yourfile > tmp
mv tmp yourfile