I am having a file in the following format
Column1 Column2 str1 1 str2 2 str3 3
I want the columns to be rearranged. I tried below
You can use Perl for that:
perl -ane 'print "$F[1] $F[0]\n"' < file.txt
The advantage of running perl is that (if you know Perl) you can do much more computation on F than rearranging columns.