I have a concatenated list (name of the file: file.txt) that contains these paths:
subject01_1/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject01_2/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject01_3/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject01_4/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject02_1/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject02_2/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject02_3/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject02_4/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject03_1/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject03_2/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject03_3/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject03_4/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject04_1/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject04_2/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject04_3/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject05_3/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
subject05_4/fmr_resting/seed_rsfc_atlas18_cen/seed1_Z_mni.nii.gz
Is there any way to paste each of these elements into another folder while extracting the subject number (e.g., subject01_1, subject01_2...), atlas number, and extension (.nii.gz). The pasted elements need to be in the nifti format and the output to look like this:
subject01_1seed_rsfc_atlas18_cen.nii.gz
subject01_2_seed_rsfc_atlas18_cen.nii.gz
subject01_3_seed_rsfc_atlas18_cen.nii.gz
subject01_4_seed_rsfc_atlas18_cen.nii.gz
...