How to enter the data into a excel and notepad that always start from a new line?
1 回表示 (過去 30 日間)
古いコメントを表示
For example, the first time I run the program and write a data in the excel or notepad file. Then I want to write the data in the same file with starting from a new line without overwrite the first result.
Here is the codes.
fid = fopen('serialno.txt', 'w'); % This portion of code writes the serial no.
fprintf(fid,'%s\n',serialno); % to the text file, if executed a notepad file with the
fclose(fid); % name serialno.txt will be open with the number plate written.
winopen('serialno.txt')
0 件のコメント
回答 (1 件)
dpb
2015 年 4 月 3 日
fid=fopen('seralno.txt','a+');
See
doc fopen
for details.
2 件のコメント
dpb
2015 年 4 月 4 日
If the above solved your problem, please "Accept" the answer...
As for Excel, that's a horse of a Microsoft color...either use COM or xlswrite with a location(*); they're not sequential text files.
(*) I presume there's some method to find the first empty location if don't keep it externally, but that's an Excel question not Matlab and "I don't do Windows... :) " Look that up in the Help for COM or ask on an Excel newsgroup.
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!