|
|
Re: reading text file line by line
Posted:
Aug 3, 2012 6:27 PM
|
|
TideMan <mulgor@gmail.com> wrote in message <09bd9d8f-818e-43d4-8a9d-1b14491f2a86@googlegroups.com>... > 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
Register Data
0x3028 0x0455920f
0x3029 0x0455964f
0x302a 0x0455950f
0x302b 0x0455910f
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
|
|