I have a number of tab delimited files, for which the script user will be choosing one based on a particular threshold. All files have different amount of columns (1 to n depending on a previously chosen threshold). The columns of the files do not have headers, however for the next program, the chosen file will require headers. The columns need to be named Q1 to Qn for this next step. As the user will may be using a file with 1 or 10 or n columns, the number of columns to be names Q1 to Qn will change each time. I am having trouble getting this wo work properly. Any suggestions?
What I want to accomplish: