Hello,
I have some tab delimited text files with a three header rows. The headers look like, (sorry the tabs look so messy).
index group Name input input input input input input input input input input input
int char string double double double double double double double double double double double
id group Name AtR_Ptb_L flatness inv_dx2 rvalHyd sumLip xv0 dxv1 Gmax k2 Spyridin_N Salph_N
The files could have any number of columns. What I need to do is simple. I just need to copy the file with one or more columns removed. The columns to be removed would be specified by the value in the third row. For example, I could want the files with columns "dxv1" and "k2" removed.
index group Name input input input input input input input input input
int char string double double double double double double double double double
id group Name AtR_Ptb_L flatness inv_dx2 rvalHyd sumLip xv0 Gmax Spyridin_N Salph_N
The order of the remaining columns should be the same. It doesn't matter how the list of columns to be removed is formatted. It can be any kind of list.
I have read posts about how to copy specific columns with cut or awk, but not how to skip specific cols and copy everything else. One thing to do would be to find the position of the cols to be removed and use cut, but how to set that up to work in a general implementation is a bit unclear to me. I also suspect that awk would be more efficient.
Any suggestions?
LMHmedchem