|
|
Re: find and replace string in a text file
Posted:
Jun 16, 2012 3:04 AM
|
|
I wrote the code in the following way:
fin = fopen('praat.txt'); fout = fopen('praat1.txt');
while ~feof(fin) s = fgetl(fin); s = strrep(s, '--undefined--', '-1'); fprintf(fout,'%s\n',s); disp(s) end fclose(fin) fclose(fout)
i wanted to replace the string --undefined-- with -1 the program shows error at: fprintf(fout,'%s\n',s); what is thee solution
|
|