[Scilab-users] Matrix of characters conversion

Samuel Gougeon sgougeon at free.fr
Mon Oct 21 15:21:04 CEST 2013


Hello,

Le 21/10/2013 14:29, Carrico, Paul a écrit :
>
> Dear All
>
> How can I convert a matrix of characters into integers when the 
> separator has different number of spaces ?
>
> The spaces come probably  from a printf format such as :    
>  printf("%10d\n",var)
>
> I 'm currently using*_csvTextScan_*  and I've some troubles/errors  with*_csvRead_*  ...
>
> _Example_:
>
> ! 300006     12799 24678     17504     21558    212801     24680     
> 17508 21560 !
>
ligne = "300006     12799     24678     17504 21558    212801     
24680     17508     21560"
evstr(tokens(ligne))  // yields:

-->evstr(tokens(ligne))
  ans  =
     300006.
     12799.
     24678.
     17504.
     21558.
     212801.
     24680.
     17508.
     21560.

HTH
Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20131021/8ab3f96b/attachment.htm>


More information about the users mailing list