I've seen many examples here on how to replace filenames using strings within the filename (for example, myfile_000121.txt changed to 000121.txt). But what if I have a separate text file where I saved all my filenames in the first column and a completely new ID in the second column? The ID is not found anywhere within the original filenames.
Here is an example of my textfile:
AA5t-666_S241_L002_R1_001.fastq.gz Species_uno_R1.fastq.gz
AA5t-666_S241_L002_R2_001.fastq.gz Species_uno_R2.fastq.gz
AA5t-662-0788-AES_L002_R1_001.fastq.gz Species_duo_R1.fastq.gz
AA5t-662-0788-AES_L002_R2_001.fastq.gz Species_duo_R2.fastq.gz
So I want to use this textfile to replace the filenames in my directory (the same names in column 1) with the new names I created in column 2. I'm only aware of how to do something like this if the ID name appears within the filename.
Thank you!