Hi, please can someone help.
I have a huge csv file with thousands of columns in it, each column has a column header (in the first row). I need to extract only the columns where the header contains a certain string.
eg. I only want to extract all the columns where the header contains the word 'fred'.
I know how to use Awk to extract columns based on the column number, but unfortunately in my case the columns I want can be in a different column number every time, the only consistent thing is that the column header contains a certain string..so I need this solution to be able to extract columns based on whether a string exists in the header or not.
If anyone can offer any suggestions using Awk or any other UNIX command I'd be most grateful.
Thankyou
Michael
I have a huge csv file with thousands of columns in it, each column has a column header (in the first row). I need to extract only the columns where the header contains a certain string.
eg. I only want to extract all the columns where the header contains the word 'fred'.
I know how to use Awk to extract columns based on the column number, but unfortunately in my case the columns I want can be in a different column number every time, the only consistent thing is that the column header contains a certain string..so I need this solution to be able to extract columns based on whether a string exists in the header or not.
If anyone can offer any suggestions using Awk or any other UNIX command I'd be most grateful.
Thankyou
Michael