Read data from text file write into another file
조회 수: 15 (최근 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!