home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: sci.math.symbolic
- Path: sparky!uunet!convex!darwin.sura.net!Sirius.dfn.de!chx400!bernina!neptune!monagan
- From: monagan@inf.ethz.ch (Michael)
- Subject: Re: MAPLE: Reading list of points from external file
- Message-ID: <1992Nov17.171435.19540@neptune.inf.ethz.ch>
- Summary: Reading data into Maple
- Sender: news@neptune.inf.ethz.ch (Mr News)
- Nntp-Posting-Host: rutishauser-gw.inf.ethz.ch
- Organization: Dept. Informatik, Swiss Federal Institute of Technology (ETH), Zurich, CH
- References: <ROSE.92Nov10172623@t524i5.telematik.informatik.uni-karlsruhe.de> <CHUCK.92Nov16190416@nimbus.drexel.edu>
- Distribution: sci.math.symbolic
- Date: Tue, 17 Nov 1992 17:14:35 GMT
- Lines: 21
-
-
- The question was asked how to read data from an external file into Maple.
- There are no facilities in Maple V for reading arbitrary data. The comment
- by one user that Maple should not call itself a programming language if
- it cannot read data is fair comment. What you must do is make the
- data that you want to read into Maple valid Maple input. I.e. if you
- have numbers on a line separated by spaces you must insert commas between
- them and assign them to a variable, and add a semicolon or colon at the end.
- I.e. make the input file look like
-
- DATA := 2.3, 3.4, 5.6 ;
-
- Once you have read the file, you can put the sequence in a list or array
- and continue. The new version, Release 2, has the equivalent of C's scanf,
- also printf, and some other utilities that make reading and writing data
- to files much easier to do. I wrote an article on how to read and write
- data from files in the share library. It's the
- file maple/5.0/tex/program.tex which you can get from
- anonymous ftp at daisy.uwaterloo.ca
-
- Michael Monagan
-