I have a list of folder names in .txt file. I want the code to pick a name from text file, match in a directory, enter that folder and a subfolder and copy a file and paste it to another directory and also add folder name in front of the file name.
For an example I have folder name A, B, C and they have sub-folder name X, Y, Z respectively. I want the code to enter A folder and then sub-folder X and then copy a file name '1' and paste it another folder and also add folder name to file i.e., 'A1' I'm using the following code but its not working
for i in CC110033; do cp /dataslave2/shyamchand/aamod_meg_maxfilt_00001/$i/rest/transdef_mf2pt2_rest_raw.fif /cblhome/vivek/Data/MEG_data_80sub/transdef_mf2pt2_rest_raw.fif; done