フィルターのクリア

Exporting multiple Excel Files

2 ビュー (過去 30 日間)
012786534
012786534 2017 年 6 月 14 日
回答済み: Akira Agata 2017 年 7 月 14 日
Hello all,
I have a folder with several text files. I am opening them and modifying them in a loop. My question is: how can I save each of them in an individual Excel file with the same name as the text file ?
Thank you

回答 (1 件)

Akira Agata
Akira Agata 2017 年 7 月 14 日
I think the MATLAB script for your question will be as follows:
fileList = dir('*.txt');
for kk = 1:numel(fileList)
% Some process which generates numeric array
...
% Save to excel file
fileName = strrep(fileList(kk).name,'.txt','.xlsx');
xlswrite(fileName, outputArray);
end

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by