Info
This question is closed. Reopen it to edit or answer.
Importing/copying contents of Multiple text files within a folder to a single text file witout disturbing the format
1 view (last 30 days)
Show older comments
I am a beginner with Matlab and trying to read multiple text files (within a single folder) with mixed contents (both strings and numbers) and with specified formatting. I want to import all the contents (without disturbing the format) of all files sequentially and export/copy to one single text file. Sequentially when I say, Files should be read based on some logic (like latest saved or file name). Can anyone help me please. I tried running the below logic but Its not working d=dir(fullfile('*.dat')); for i=1:length(d) F = fopen('Try.dat','a+'); fprintf(F,'%s\n',i); i=i+1; end
0 Comments
Answers (1)
Image Analyst
on 19 May 2015
See the FAQ: http://matlab.wikia.com/wiki/FAQ#How_can_I_process_a_sequence_of_files.3F Let us know if you still can't figure it out.
1 Comment
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!