Lets say I have this file (main)
Name samp1 samp2 samp3 samp4
pg1 0.43 0.32 0.21 0.54
pg2 0.43 0.22 1.00 0.44
pg3 0.11 0.99 0.78 0.54
pg4 0.65 0.32 0.12 0.23
I also have this header file below (MAPPERS)
SampName ID
samp1 TYC
samp4 GDD
samp6 DER
samp2 JKK
samp3 WER
samp9 AXC
I wish to change all the headers of my "main" file using the "MAPPERS" file, such that if there is a match with the sampleName, then it should be replaced by the sample IDs. So I expect to have the following:
Name TYC JKK WER GDD
pg1 0.43 0.32 0.21 0.54
pg2 0.43 0.22 1.00 0.44
pg3 0.11 0.99 0.78 0.54
pg4 0.65 0.32 0.12 0.23
I have a large file, so can anyone help me how to get the above?