I have a file containing a big table, something like that :
Header1 Header2 Header3 ... Header8031
Value1 Value2 Value3 .... Value8031
.
.
Value1 Value2 Value3 ... Value8031
In another file I have a list with some headers of the previous table.
Header1
Header3000
Header5
Header200
Header10
I want to extract the information in the table only for the headers in the list. In other words, getting the columns that match with the headers on the list. [matching the list with the columns id on the tables]
Output
Header1 Header3000 Header5 Header200 Header10
Value1 Value3000 Value5 Value200 Value10
Value1 Value3000 Value5 Value200 Value10
I tried some examples with awk
(AWK extract columns from file based on header selected from 2nd file), but I'm not able to get my desired output.