Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: find and replace string in a text file
Replies: 17   Last Post: May 12, 2013 5:58 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
jive.aditi@gmail.com

Posts: 1
Registered: 6/16/12
Re: find and replace string in a text file
Posted: Jun 16, 2012 3:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.