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
- References:
- Help with formatting output
- From: Diana <diana.mecum@gmail.com>
- Help with formatting output