Hi, I have several files in a folder with a different prefix. For example:
HCOMB0001_ATTACTC-TATAGCC_L001_R1.fastq
HCOMB0001_ATTACTC-TATAGCC_L002_R1.fastq
HCOMB0001_ATTACTC-TATAGCC_L002_R2.fastq
HCOMB0002_ATTACTC-ATAGAGG_L001_R1.fastq
HCOMB0002_ATTACTC-ATAGAGG_L002_R1.fastq
HCOMB0002_ATTACTC-ATAGAGG_L002_R2.fastq
HCOMB0003_ATTACTC-CCTATCC_L001_R1.fastq
HCOMB0003_ATTACTC-CCTATCC_L002_R1.fastq
HCOMB0003_ATTACTC-CCTATCC_L002_R2.fastq
. . .
These were sequence output files that I did some processing on so basically L001/L002 or R1/R2 doesn't mean anything anymore (I am not good at modifying the names after processing). All I want is all files with starting string 'HCOMB0001' get merged into one single file and similarly other files with respective prefixes. I looked up many solutions but most of them are based on read names or lane names etc and did not work for me since those parameters do not matter in my case. Any Ubuntu bash script to perform the operation will really be appreciated. Thanks for any help!
try this and remove echo before execution:
create a directory (eg. combined) in the same folder where fastqs are located and output would be written to that directory (eg. combined)