Copying multiple files to a location using wildcard

조회 수: 15 (최근 30일)
James hall
James hall 2012년 9월 12일
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,
  댓글 수: 1
Sean de Wolski
Sean de Wolski 2012년 9월 12일
What errors? Please post the whole error message.

댓글을 달려면 로그인하십시오.

답변 (1개)

Srinivas
Srinivas 2012년 9월 12일
As per the help document
copyfile('Projects/my*','../newProjects/') so it should be
copyfile([RawCSVfolder '\*.csv'],ProcessedFoldersDirectory);
HTH
  댓글 수: 3
Walter Roberson
Walter Roberson 2012년 9월 13일
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 2012년 9월 13일
yup these should be in curly brackets, made this mistake too many times:
RawCSVfolder=RawCSVfolder{WhichLocation};
ProcessedFoldersDirectory = ProcessedFoldersDirectory{WhichLocation}

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Data Import and Analysis에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by