Hi,
I have a tab delimited file that has duplicate columns (hundreds):
> cat realfile
1 1 0 0 1 1
1 1 0 0 0 0
0 0 1 1 1 1
0 0 1 1 0 0
0 0 0 0 0 0
I want to produce:
> cat wishfile
1 0 1
1 0 0
0 1 1
0 1 0
0 0 0
I know I could do
awk '{print $1, $3, $5)' realfile > wishfile
But it seems silly. I know there must be a better way, since we can index the columns, but can we use $X as the index instead of the number? Any other command that works is fine too, it doesn't have to be in awk.
Thanks for taking the time to help me
