Read data from text file write into another file
13 次查看(过去 30 天)
显示 更早的评论
Hi
How to read the following text
'*$rinu*'
from myfile.txt
and Write the same into myfile1.txt.
Thanks in Advance
0 个评论
回答(1 个)
Kojiro Saito
2019-12-25
I think low level file I/O is enough for this case.
fid = fopen('myfile.txt');
data = fscanf(fid, '%s');
fclose(fid);
fidw = fopen('myfile1.txt', 'w');
fprintf(fidw, '%s', data);
fclose(fidw);
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Text Files 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!