external files and strings
- To: mathgroup at smc.vnet.net
- Subject: [mg22585] external files and strings
- From: Otto Linsuain <linsuain+ at andrew.cmu.edu>
- Date: Sun, 12 Mar 2000 22:55:30 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello. I need to store graphic results from a series of calculations which I run in batch mode. I try the following and I can't see what is going on: Do[ Plot[Sin[i x], {x,0,Pi}, DisplayFunction->Identity] >> "sin"<>ToString[i]<>".m", {i,1,10}] You can actually run this on a Notebook and it will just create ten files sin1.m to sin10.m in your directory. you can open any of them in the same or another Notebook: sin1 = << "sin1.m" Display[$Display,sin1], etc and you will see each one of the graphs. So far, so good. Now comes the problem: When I run that Do[ Plot.... ...{i,0,1}] command in batch mode (converting the Notebook to a text file and so on) it creates only one file called sin ( no 1,2 or .m) and in the out file I find the following error: StringJoint::string: String expected at position 1 in Null<>1<>.m It seems to be unable to read the first position of the file name string in batch mode! I have tried adding more strings, but it is only the first that causes confusion, so if I try to call the file: "sin"<>ToString[i]<>"times x ... and so on, the error message shows the rest of the strings OK, but position 1 interprets as Null. What is going on? Any ideas of how to fix this? Thanks a lot. Otto Linsuain. P.S. I know this seems like a very benign problem, but if I can't get the computer to bookkeep a long series of results of long calculations, I will go crazy trying to figure out which graph is which!
- Follow-Ups:
- Re: external files and strings
- From: Jean-Marie Thomas <jmt@agat.net>
- Re: external files and strings