reading data from a file



It seems this is a problem on my version of maxima 
which is the latest beta before 5.10, which I
managed to manually compile for Ubuntu,
but it works on 5.10 on Fedora 5.

Maybe it is a problem related to my specific
distribution.

  Fabrizio





On Thu, 16 Nov 2006, Richard Fateman wrote:

> If your file only has numbers and you want to read them as numbers
> and they are acceptable to lisp ---  of the form 1.2  3  4.0d0
> you should be able to use the lisp read function, e.g.
> in the program below, do  tmp:?read(s)
> 
> and then you don't have to parse strings into numbers.
> 
> There is also a lisp function read-from-string that you might use.
> 
> My success in the earlier example was on wxmaxima, whatever lisp that is 
> built on.
> 
> RJF
> 
> 
> 
> van Nek wrote:
> 
> > 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
> >
> >------------------------------------------------------------------------
> >
> >_______________________________________________
> >Maxima mailing list
> >Maxima at math.utexas.edu
> >http://www.math.utexas.edu/mailman/listinfo/maxima
> >  
> >
>