I have 120 pairs of files I would like to concatenate. I have the list of pair of files and the proposed merged file name in a tab delimited file as follows
Filelist.txt
/filepath/1_first.fasta /filepath/1_second.fasta > /filepath/1_merged.fasta
/filepath/2_first.fasta /filepath/2_second.fasta > /filepath/2_merged.fasta
/filepath/3_first.fasta /filepath/3_second.fasta > /filepath/3_merged.fasta
/filepath/4_first.fasta /filepath/4_second.fasta > /filepath/4_merged.fasta
I was trying:
$cat Filelist.txt | perl -ne 'chomp;system("cat $_;")'
with the idea of handling the Filelist.txt line by line and using the cat command on the line which for the first line should be...
/filepath/1_first.fasta /filepath/1_second.fasta > /filepath/1_merged.fasta
If I just have one pair and a single line in the Filelist.txt it works fine but with multiple lines I just get ..
/filepath/2_first.fasta: No such file or directory
$
Any clues why this might not be working for every single line? Or an alternative way to do this?
Thanks