I have a file with a very large number of columns (basically several thousand sets of threes) with three special columns (Chr
and Position
and Name
) at the end.
I want to move these final three columns to the front of the file, so that that columns become Name Chr Position
and then the file continues with the trios.
I think this might be possible with awk
, but I don't know enough about how awk
works to do it!
Sample input:
Gene1.GType Gene1.X Gene1.Y ....ending in GeneN.Y Chr Position Name
Desired Output:
Name Chr Position (Gene1.GType Gene1.X Gene1.Y ) x n samples