I have fasta.qz sequence files with identical names, but in two different folders that I need to concatenate (concatenate always those two with identical names only!). The directory structure looks like this:
sequences
**|--folderA**
| \-- \--MOSA_F_TAC01n.1.fq.gz
| \-- --MOSA_F_TAC08n.rem.1.fq.gz
| \-- --WAIN_N_15m.rem.2.fq.gz
| \-- --MOSA_F_TAC01n.2.fq.gz
| \-- --MOSA_F_TAC08n.rem.2.fq.gz
| \-- --WAIN_N_16m.1.fq.gz
| \-- --MOSA_F_TAC01n.rem.1.fq.gz
| \-- --PAUA_F_16v.1.fq.gz
| \-- --WAIN_N_16m.2.fq.gz
| \-- --MOSA_F_TAC01n.rem.2.fq.gz
| \-- --PAUA_F_16v.2.fq.gz
**| \--folderB**
| \-- --MOSA_F_TAC01n.1.fq.gz
| \-- --MOSA_F_TAC08n.rem.1.fq.gz
| \-- --WAIN_N_15m.rem.2.fq.gz
| \-- --MOSA_F_TAC01n.2.fq.gz
| \-- --MOSA_F_TAC08n.rem.2.fq.gz
| \-- --WAIN_N_16m.1.fq.gz
| \-- --MOSA_F_TAC01n.rem.1.fq.gz
| \-- --PAUA_F_16v.1.fq.gz
| \-- --WAIN_N_16m.2.fq.gz
| \-- --MOSA_F_TAC01n.rem.2.fq.gz
| \-- --PAUA_F_16v.2.fq.gz
As you see, the file names are identical (their content is not, i.e., it is complementary thus need to cat
). I would like to keep the files' names and concatenate the identical files into one single file with said name (in e.g. a new folder named folderC).
--
or is that filler for your example material? if so, what named them? globbing that oneval set --*
would drop three chars (the same count in../
incidentally) for each name, and most standard utility command lines would effect similar drops...