[scilab-Users] weird problem with fscanfMat

Antoine Monmayrant antoine.monmayrant at laas.fr
Wed Feb 9 10:07:25 CET 2011


Le 09/02/2011 09:26, Stéphane Mottelet a écrit :
> Le 09/02/2011 09:24, Antoine Monmayrant a écrit :
>> Le 08/02/2011 22:04, Stephane Mottelet a écrit :
>>> Hi all,
>>>
>>> I cannot manage to read the attached file with
>>> fscanfMat, although it has a compatible structure,
>>> i.e. one line one text then many lines of the same
>>> number of columns.
>>>
>>> I have even tried to read the first line with mgetl,
>>> but then eof is reached although I only get the first line
>>> (composed of text).
>>>
>>> I know each line is only finished with a cr and not
>>> an eol. Is it a problem ?
>>> Thanks for help of anybody willing to solve this
>>> weird issue !!!
>>>
>>> S.
>> When I open the file you attached to your email, I don't see any 
>> separator to mark the end of line (no cr, no \n, no nothing).
>> It might have been mangled by my mail program but I doubt it.
>> I managed to open it in scilab with read_csv and it also looks like 
>> there is no separator at the end of line: the last item of a line is 
>> touching the first item on next line:
>>
>> -->a_string=read_csv("20101122_VOLUME.txt","\t");
>>
>> -->a_string(16)
>> ans  =
>>
>>  ch15 (L)0.000
>>
>> -->a_string(31)
>>  ans  =
>>
>>  0.0000.001
>>
>> -->a_string(46)
>>  ans  =
>>
>>  0.0000.002
>>
>>
>> Hope it helps,
>>
>> Antoine
>>
> Well, when I open it with vi, I see some ^M at the end of each line.
>
> S.
I don't, so it has been mangled in the process.
With :set list, I can see the column separator (^I), but nothing at the 
end of line, the two adjacent items being merged...

Antoine
PS: I join your file back, can you check if it has been modified or not?
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 20101122_VOLUME.txt
URL: <https://lists.scilab.org/pipermail/users/attachments/20110209/451250ba/attachment.txt>


More information about the users mailing list