problem when write first line to text file
Mostra commenti meno recenti
hi: I met some problem when tried to write the first line to text file. below is what the base test file was.

I use the command:
fid = fopen('test.txt','r+')
fprintf(fid,'%s\n','abc');
fclose(fid)
but the result becomes like below:

the first number is deleted.but I could not find why.
could anyone give me some suggestions?
thanks! Li
1 Commento
KSSV
il 6 Mar 2017
I think you cannot write in first line. Better read the content and write to a new text file with first line of your choice.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Standard File Formats in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!