Copying multiple files to a location using wildcard

10 visualizzazioni (ultimi 30 giorni)
Hi,
How can I use the copyfile command to copy multiple files of extension '*.csv' to a specific location?
I tried this but it gave errors:
copyfile(fullfile(RawCSVfolder,'*.csv'),ProcessedFoldersDirectory);
Thanks,

Risposte (1)

Srinivas
Srinivas il 12 Set 2012
As per the help document
copyfile('Projects/my*','../newProjects/') so it should be
copyfile([RawCSVfolder '\*.csv'],ProcessedFoldersDirectory);
HTH
  3 Commenti
Walter Roberson
Walter Roberson il 13 Set 2012
What value does ProcessedFoldersDirectory have at that point? Is it possibly the value 0 ? Or possibly a cell string rather than a plain string?
Aadil
Aadil il 13 Set 2012
yup these should be in curly brackets, made this mistake too many times:
RawCSVfolder=RawCSVfolder{WhichLocation};
ProcessedFoldersDirectory = ProcessedFoldersDirectory{WhichLocation}

Accedi per commentare.

Categorie

Scopri di più su MATLAB Report Generator in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by