MathGroup Archive 2007

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

Search the Archive

Re: Help with formatting output


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