Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2007
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Help with formatting output

  • To: mathgroup at smc.vnet.net
  • Subject: [mg77747] Re: Help with formatting output
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Fri, 15 Jun 2007 06:31:19 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <200706140922.FAA06668@smc.vnet.net><f4r5h1$btk$1@smc.vnet.net> <f4tip7$fdi$1@smc.vnet.net>

Diana wrote:
> Tim,
> 
> Thanks. Can you suggest a way to convert the two column output of this
> command to a text file, and eliminate the extra formatting characters?
> 
> Diana

What you need in this case is the *Export* function with some tweaking 
to get a text file in which the columns are separated by only /one/ space.

In[1]:= lst = {35, 36, 2, 4, 5};
Export["myFile.txt", MapIndexed[StringJoin[ToString[#2[[1]]], " ",
          ToString[#1]] & , lst], "Lines"]
FilePrint[%]

Out[2]= "myFile.txt"

During evaluation of In[1]:=
1 35
2 36
3 2
4 4
5 5

Regards,
Jean-Marc


  • Prev by Date: Re: Order of terms
  • Next by Date: Re: Eigenvalues
  • Previous by thread: Re: Re: Help with formatting output
  • Next by thread: Re: Help with formatting output