Ältere Kommentare anzeigen
I have a text files which contain only one data. What I want to do is to save all datas in one text file, for example the file is in folder named J and in this folder there are files like a_1.txt,a_2.txt ...a_i.txt where i can be any posetive integer. These text files contains only one data and it is a number. The idea I want is to save all these files in one file and arrange the numbers accordingly. Any idea would be appreciated. Regards
Antworten (1)
Fangjun Jiang
am 11 Okt. 2011
I guess I found another use of an old trick. Check the value of the string "Cmd" after running the following three lines of code.
NumberOfFile=20;
Str=sprintf('a_%d.txt+',1:NumberOfFile-1);
Cmd=['copy ',Str,'a_',num2str(NumberOfFile),'.txt Output.txt'];
And then run:
System(Cmd);
The combined text file will be in Output.txt
Kategorien
Mehr zu Text Files finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!