MATLAB Answers

Read data from text file write into another file

11 views (last 30 days)
srinu siliveru
srinu siliveru on 25 Dec 2019
Answered: Kojiro Saito on 25 Dec 2019
Hi
How to read the following text
'*$rinu*'
from myfile.txt
and Write the same into myfile1.txt.
Thanks in Advance

  0 Comments

Sign in to comment.

Answers (1)

Kojiro Saito
Kojiro Saito on 25 Dec 2019
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 Comments

Sign in to comment.

Products


Release

R2018b

Translated by