I have files named
patient_sample_L001_R1_001, patient_sample_L002_R1_001, patient_sample_L003_R1_001, patient_sample_L004_R1_001
another set named
patient_sample_L001_R1_002, patient_sample_L002_R1_002, patient_sample_L003_R1_002, patient_sample_L004_R1_002,
and so on and so forth. For each set of 4 files (with different end numbers 001,002,003) i need to move it into an appropriate directory labelled patient0001, or patient 0002, and so on and so forth. I have around 200 of these sets. Is there a command I can do that scans for files with a different end number and puts it into the appropriate patient folder?
i.e patient_sample_L001_R1_001, patient_sample_L002_R1_001, patient_sample_L003_R1_001, patient_sample_L004_R1_001, goes into "patient0001 folder and etc.
Each of these files are in different directories. For example main directory has a directory called run40 in it there is the patient1 data. Then in run41 there is the patient 2 data and etc.. back in the main directory there is another directory called "total_patient_samples"that is where you can find all the directories that i want to move the files from the "run40, run41" directories into. In that file there is patient0001, patient 0002, patient 0003. I would like the aforementioned data files to go into there.