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

Celso Co celso.co at gmail.com
Sun Sep 26 14:14:15 CEST 2010


Dear Peng,

Attached files are my solution. The "list" takes in variable length
row vectors. The "execstr" put your text variable in code execution.
It is some sort of second level of interpreter.

I hope this help you.

Regards
Celso



On Sat, Sep 25, 2010 at 4:28 PM, Peng Du <eddy.pdu at gmail.com> wrote:
> 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
>
>



-- 
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 --------------
A non-text attachment was scrubbed...
Name: text.sce
Type: application/octet-stream
Size: 96 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20100926/4d5cb9b4/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: read1.sci
Type: application/octet-stream
Size: 148 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20100926/4d5cb9b4/attachment-0001.obj>


More information about the users mailing list