listing files in textfile
Info
This question is closed. Reopen it to edit or answer.
Show older comments
k
1 Comment
Walter Roberson
on 13 Aug 2012
The fprintf() could be simplified to
fprintf(fff, '%s\n', fileNames{i});
Answers (1)
Walter Roberson
on 13 Aug 2012
0 votes
The order of files returned by dir() is "whatever is returned by the underlying operating system". In turn operating systems might use different orderings depending on the variety of filesystem being used.
You must therefore sort the names before you print them out. See http://www.mathworks.com/matlabcentral/fileexchange/8399-sortn-sort-textual-lists
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!