From: Mikesh Udani on
Hello,
I am using textscan to read a text file that has hundreds of lines and each value in a line delimited by a space. To be precise, these are the commands i'm using:

>> fid=fopen('m5nonreas_m5nonreas3gm.txt');
>> c=textscan(fid,'%s %s %f %s %f %s %f %s %s %s %s %f %s %f %s %f','delimiter',' ');

but its only reading the 25 lines.

>> size(c{1})

ans =

25 1

Can anybody point out whats wrong?

Thanks a lot
Mikesh
From: Walter Roberson on
Mikesh Udani wrote:
> Hello, I am using textscan to read a text file that has hundreds of
> lines and each value in a line delimited by a space. To be precise,
> these are the commands i'm using:
>
>>> fid=fopen('m5nonreas_m5nonreas3gm.txt');
>>> c=textscan(fid,'%s %s %f %s %f %s %f %s %s %s %s %f %s %f %s
>>> %f','delimiter',' ');
>
> but its only reading the 25 lines.
>>> size(c{1})
>
> ans =
>
> 25 1
>
> Can anybody point out whats wrong?

Not without a copy of the 25th and 26th line.

My leap-in-the-dark guess would be that on the 26th line, one of the
strings has a space in it. %s only reads until the first Delimiter
(e.g., space)