Re: Re: Write problem with {}
- To: mathgroup at smc.vnet.net
- Subject: [mg9531] Re: [mg9507] Re: [mg9466] Write problem with {}
- From: David Withoff <withoff>
- Date: Thu, 13 Nov 1997 01:39:59 -0500
- Sender: owner-wri-mathgroup at wolfram.com
> > > > With mathematica output, I was trying to write it into file. But with {} > > character, the number was written. As an example, If I'd like to write > > 3.0123, in file the number was written in the following way. > > > > {3.0123} > > > > I used the funtion Write[] and >>, but the results was same. How can I > > write rightly ? > > When I want to write things to a file and not have mathematica insert > commas and braces, I convert everything into a String with ToString and > write that. I am not totally sure, but I think the braces only get > written around number typ objects or list elements. I noticed in a later posting that you were able to solve this problem, so this is just a (hopefully useful) followup comment. If curly braces are present in the written output, it is because they were present in the input. Mathematica doesn't insert curly braces that weren't already there. For example, if x={3.0123} is written to a file, the result will include the curly braces. In this example, one way to get rid of the curly braces is to write x[[1]] instead. Writing to a file, at least for simple text formats like InputForm and OutputForm, is no different than writing to the computer screen. One convenient way to work out the file format that you want is to first get that output on the computer screen. Dave Withoff Wolfram Research