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: reading text file line by line
Replies: 10   Last Post: Aug 4, 2012 8:50 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Leyo Joseph

Posts: 67
Registered: 3/19/09
reading text file line by line
Posted: Aug 3, 2012 3:03 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello,

I have a big text file called data.txt. Would like to read this to Matlab.
I am trying to do this with the following code==>

KK=fopen('F:\commands\data.txt');
A=fscanf(KK,'%s');

This reads the whole content of data.txt to A without any line breaks or spaces. How to make it read line by line and keeping the spaces as in data.txt?

Thanks
Leyo



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

[Privacy Policy] [Terms of Use]

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