I have file names provided in a tab separated file.
Ex:
file1 file2 file3
file4 file5
file6 file7 file8 file9 file10
file11 file12
......and so on.
I need to be able to do:
cat file1 file2 file3 > newfile1
cat file4 file5 > newfile2
cat file5 file7 file8 file9 file10 > newfile3
.....
There are a total of 140 lines to this file, and multiple file names per row. Within each row I need to concatenate the files. Each file name has a uniq name, so I need to name the new file something different.
There are leading characters in each file prefix that I would like to use to rename. For example, (file1) A1-2_B1.txt and (file2) A1-4_B1.txt would be concatenated to file A1_B1.txt
Any suggestion? All help is appreciated.
I know I can use
(cat inputs.txt | -n 140 cat) >> newfile.txt
to use a file with filenames per individual line to make a single new file. However, I am having trouble with the multiple files per line, to make multiple new files.
I'm wondering if I put all output filenames into a text file, such as:
A1_B2.txt
A2_B3.txt
..etc...
and using something like:
(cat inputs.txt | cat) >> (cat outputs.txt)
if it will work.