clinica icon indicating copy to clipboard operation
clinica copied to clipboard

ADNI_to_BIDS utils : `load_clinical_csv`, hidden csv file matching, issue #1163

Open HuguesRoy opened this issue 1 year ago • 1 comments

Fix issue #1163

Change re.search by re.match.

It will avoid hidden file matching by constraining to an exact match with the pattern

if we have two files:

  • correct file: ADNIMERGE_25Apr2024.csv
  • hidden file: .ADNIMERGE_25Apr2024.csv

the pattern is "ADNIMERGE"+ r"(_\d{1,2}[A-Za-z]{3}\d{4})?.csv", only the correct file will be returned.

HuguesRoy avatar May 29 '24 14:05 HuguesRoy

I would prefer changing the rglob regex to not consider hidden files at all (either check on beginning of string or different rglob match but I would need to check how to). WDYT @NicolasGensollen ?

AliceJoubert avatar May 29 '24 14:05 AliceJoubert

Closed by #1343

NicolasGensollen avatar Oct 22 '24 16:10 NicolasGensollen