Re: Exporting data into a file, OpenWrite
- To: mathgroup at smc.vnet.net
- Subject: [mg96702] Re: Exporting data into a file, OpenWrite
- From: Bill Rowe <readnews at sbcglobal.net>
- Date: Sat, 21 Feb 2009 19:39:34 -0500 (EST)
On 2/20/09 at 5:47 AM, nandhini.gopalan at gmail.com (Nandhini) wrote: >Frnds, Im getting an output tat is very big and i cant view that >withitn the available screen. Im trying to write it into a file but >i dont understand where it is. Will OpenWrite help?? I wnat the ans >to be written to a notepad. is there any otehr way of exporting the >data? OpenWrite is not likely to be what you want. This only opens a file so that something can be written to the file. In most cases, you will want to use Export. In addition to creating a file, Export writes the data out in the specified format and finishes by closing the file. You indicated you want the "ans to be written to a notepad". I take this to mean you want ASCII output that can be read by the Notepad application. If I have this correct, then Export[filename, data, "Table"] will do what you want. Here, data is a variable that contains the information to be written to the file. There are many possible formats to use with Export in addition to "Table". Quite possibly, a different format would be better for your needs. So, it would probably be good for you to look at the documentation for Export using the Documentation Center. When you use Export, the file will be created in the current working directory. That is the directory that is returned by Directory Finally, you indicate your reason for writing the output to because the output is too large to be viewed on your screen. Mathematica offers a variety of ways to view output from calculations. Quite likely one or more of these might actually be more useful than writing the output out to a file and using some other application to view it. But without details of what output you are currently having difficulty with and what it is you are trying to do, I cannot offer specific suggestions.