TideMan <email@example.com> wrote in message <firstname.lastname@example.org>... > On Saturday, August 4, 2012 7:03:27 AM UTC+12, Leyo Joseph wrote: > > 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 > > A=fscanf(fid,'%c');
This method works...not exactly as I want.
my data.txt file is something like this==>
Reading the Power to input of Pre-Scaler
Block read from MERA3
Is it possible to read in such a way that A(1,1) is the first whole line, A(1,2) is the second whole line so on... Also is there a way to skip the read if a particular line is empty? Thanks, Leyo