I have this folder.
Let's consider the files: sub-OAS30027_ses-d1300_run-01_T1w.nii.gz and sub-OAS30027_ses-d1300_run-02_T1w.nii.gz. They have the same initial part of the name, that is sub-OAS30027_ses-d1300.
I would like to code a script in Python that extract only one file among the ones with the same sub-OAS30027_ses-d1300, among the one with the same sub-OAS30031_ses-d0427 and so on. It's not important which file is extracted, just one.
This because sub-OAS30027_ses-d1300_run-01_T1w.nii.gz and sub-OAS30027_ses-d1300_run-02_T1w.nii.gz are like copies and i don't want them.
Could you help me ?
