[Maxima] reading data from a file

van Nek van.nek
Thu Nov 16 14:29:27 CST 2006


Am 16 Nov 2006 um 12:39 hat Fabrizio Caruso geschrieben:


> but I can't find a way to read from a file.
> 
>   Fabrizio

Hi Fabrizio,

in the package stringproc you find functions for input and output ...

(%i1) load("stringproc")$
(%i2) s: openr("D:/test.txt");
(%o2) 			  #<input stream D:/test.txt>
(%i3) while stringp( tmp:readline(s) ) do print(tmp)$
Hello, 
world! 
(%i4) close(s)$

... and for parsing and manipulating strings. One exception: These functions cannot work 
with bigfloats. In case of bigfloats you should consider function parse_string, which can be 
loaded by load("eval_string").

HTH
Volker

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20061116/cdfc02c9/attachment.htm 



More information about the Maxima mailing list