Exporting multiple Excel Files
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (1)
Akira Agata
am 14 Jul. 2017
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
0 Kommentare
Siehe auch
Kategorien
Mehr zu Spreadsheets finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!