[Scilab-users] Reading numericaldata from txt file containing headlines

Amanda Osvaldo lambdasoftware at yahoo.es
Fri Mar 3 13:42:25 CET 2017


Hi,
if your data it's tabular, in another words, you can open it in Excel
or Libre Office Calc like you whant to do.
You should be able to read in the same way with csvRead, however you
need to adjust the parameters
Something like:
[M, comments] = csvRead('myfile.txt', '	', [], [], [], [], [],
5);
Note that ' ' need to be the same separator in your text file.May be it
can be a TAB (the key in keyboard) or a simple space, you need try or
open your file and check it.
And the 5 value it's to ignore the first 5 lines.
https://help.scilab.org/docs/6.0.0/en_US/csvRead.html
Is that what you are looking for ?
-- Amanda Osvaldo

On Fri, 2017-03-03 at 13:09 +0100, Jens Simon Strom wrote:
>     Hi, 
> 
>     with
> 
>     x=read(file,-1,2)
> 
>     I can read the data from a text file containing e. g. 
> 
>     
> 
>     1  2.12       First line of text file
> 
>     2.12   3.2
> 
>     3 2
> 
>     4  2
> 
>     5 2.
> 
>     6     2
> 
>     7 2 
> 
>                 Last line empty
> 
>     
> 
>     What can I do to read only the numbers from a text file like
> 
>     
> 
>     Header 1     First line of text file
> 
>     Header 2
> 
>     
> 
>     
> 
>     1 2.12
> 
>     2.12 3.2
> 
>     3 2
> 
>     4 2
> 
>     5 2.
> 
>     6 2
> 
>     7 2
> 
>                 Last line empty              
>     
> 
>     
> 
>     where the data start in the 5th line?
> 
>     
> 
>     Regards, Jens
> 
>     
> 
>   
> 
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170303/76ae8986/attachment.htm>


More information about the users mailing list