I have a dataframe that looks like this:
CHROM POS p3_150 p3_166 p3_128 ......
scaffold1 834 4,1 5,7 6,0
scaffold1 950 5,0 11,0 5,0
What I wish to do is to extract every column starts from 3rd column and save them to separate files. The output files looks like:
p3_150.txt
p3_150
4,1
5,0
p3_166.txt
p3_166
5,7
11,0
p3_128.txt
p3_128
6,0
5,0
Is there a simple way to do the task without manually cut -f each column and save to files? Any suggestion will be very appreciated.
As in R? Or you are just referring to a data matrix that way.