[scilab-Users] reading data with different number of columns

Peng Du eddy.pdu at gmail.com
Sat Sep 25 10:28:05 CEST 2010


Many thanks Celso - how can I put the fields of each line in the vectors
like I did with mscanf?

Best,

Peng

On 25 September 2010 04:08, Celso Co <celso.co at gmail.com> wrote:

> Dear Peng,
>
> You can read it as text file. In attached file, run "read.sci" to read
> "text.sce".
>
> Regards
> cco
>
> On Sat, Sep 25, 2010 at 4:08 AM, Peng Du <eddy.pdu at gmail.com> wrote:
> > Dear all,
> > How am I suppose to read a data file that does not have a unified length
> for
> > each entry? The file looks like:
> > 01 02 03 04 05
> > 01 02 03
> > 01 02 03
> > 01 02 03
> > 01 02 03 04 05
> > 01 02 03 04 05
> > 01 02 03
> > 01 02 03
> > I tried  [num_read, val(1),val(2),val(3),val(4),val(5)] = mfscanf(fid,
> "%d
> > %d %d %d %d"), but it didn't work.
> > Thanks very much.
> > Regards,
> > Peng
> >
>
>
>
> --
> Eng'r Celso B. Co, PhD ECE
> Assistant Professor
> Dept. of Electronics, Computer, and Communication Engineering,
> Loyola Schools of Science and Engineering, Ateneo De Manila
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20100925/2fd84d7c/attachment.htm>


More information about the users mailing list