I am trying to use awk in a for loop to take 2 different columns everytime from one file and write them into multiple files. Plus, these files should be named after the each line of another file.
File_A
Jan Z H T K L A
Feb Q V H G E T
Mar W O P J K L
Apr N M B V C X
I want to create multiple text files taking column1(months)+column2 from File_A for the first time and column1+column3 for the second and column1+column4 for the third and so on.
File_B
2010
2011
2012
2013
2014
2015
Then, name these files with each row from File_B (file_2010.txt, file_2011.txt, ...).
I tried to do it like this, but it does not write the files.
for L in {2010..2015}; do awk '{print $1'\t'$2}' File_A.txt > file_{L}.txt; done
Thanks for any solution!