Read data from text file write into another file

1 Ansicht (letzte 30 Tage)
srinu siliveru
srinu siliveru am 25 Dez. 2019
Beantwortet: Kojiro Saito am 25 Dez. 2019
Hi
How to read the following text
'*$rinu*'
from myfile.txt
and Write the same into myfile1.txt.
Thanks in Advance

Antworten (1)

Kojiro Saito
Kojiro Saito am 25 Dez. 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);

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by