RE: Difference between Get[] and Copy-Past operation
- To: mathgroup at smc.vnet.net
- Subject: [mg32515] RE: [mg32500] Difference between Get[] and Copy-Past operation
- From: Ariel Fligler <ariel.fligler at cellpay.biz>
- Date: Fri, 25 Jan 2002 02:57:44 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, Thanks for your reply. My file consist only of Mathematica commands, but it seems that Mathematica can't parse it using Get[], but does digests the contents when I copy-Paste them myself. Any idea ? Thanks, Ariel. -----Original Message----- From: jmt [mailto:jmt at agat.net] To: mathgroup at smc.vnet.net Subject: [mg32515] Re: [mg32500] Difference between Get[] and Copy-Past operation Get is used to read Mathematica expressions : if your file named "myFile.m" consists of : {elem1,elem2} myList=Get[myFile.m] will set the variable myList to be a list containing elem1 and elem2. if "myFile.m" consists of Plus[1,1] myVar=Get[myFile.m] will set myVar to be 2, since Plus[1,1] will evaluate to 2. If you want to read some text, use the Read function. On Thursday 24 January 2002 11:20, Ariel Fligler wrote: > Greetings > > I have a text file with Mathematica commands that I generate using a Java > program (I don't want to use JLINK). When I do a copy-paste operation of > the file contents into Mathematica, everything works fine. When I do > Get["myfile.txt"], I get lots of spelling and syntax errors. It seems that > Get does not parse the file right. Are there any configuration parameters I > should set in Mathematica for this to work ? I could not find any. > > Thank you in advance for any help, > > Ariel.ariel. > fligler at cellpay.biz