フィルターのクリア

How to save the textfiles in another paste?

2 ビュー (過去 30 日間)
Daniela Correa
Daniela Correa 2018 年 4 月 20 日
コメント済み: Daniela Correa 2018 年 4 月 20 日
Hello, I have this rotine, and I want to save the textfiles in another paste.
mainFolder = uigetdir('C:\Users\Dani\Documents\PORTUGAL\Error_Sims'); % Select your Main folder
[~,message,~] = fileattrib([mainFolder,'\*']);
fprintf('\n There are %i total files & folders.\n',numel(message));
allExts = cellfun(@(s) s(end-2:end),{message.Name},'uni',0);% Get file ext
TXTidx = ismember(allExts,'txt');% Search extensions for "CSV" at the end
TXT_filefolders = {message(TXTidx).Name}; % Use idx of TXTs to list paths.
fprintf('There are %i files with *.txt file ext.\n',numel(TXT_filefolders));
for ii = 1:numel(TXT_filefolders)
movefile(['(TXT_filefolders(ii)', 'C:\Users\Dani\Documents\PORTUGAL\Pasta_Erros','f'])
end
But I have the Error : Error using movefile No matching files were found.
How I can save it ? The TXT_filefolders is a cell

採用された回答

Rik
Rik 2018 年 4 月 20 日

Without actually having delved through your code, you could try the modification below.

movefile(TXT_filefolders{ii}, 'C:\Users\Dani\Documents\PORTUGAL\Pasta_Erros','f')
  1 件のコメント
Daniela Correa
Daniela Correa 2018 年 4 月 20 日
Thank You !!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by