For example, you have:
name 1 2 3 4 5 6 7 8
With tab delimiter ^
And I want to switch between 2 columns (for example 7th and 8th if you start with 0) so it would look like:
name 1 2 3 4 5 6 8 7
Eventually, it should be probably other column indexes..
I tried using awk but got a lot of errors. Could you explain?
The command I tried was:
awk ' { t = $10; $10 = $9; $9 = t; print > "test2.txt"; } ' test.txt
It created a new file, but without the tab delimiter. (With space delimiter)