Re: Trying to export two column table to text file
- To: mathgroup at smc.vnet.net
- Subject: [mg77852] Re: Trying to export two column table to text file
- From: Bill Rowe <readnewsciv at sbcglobal.net>
- Date: Mon, 18 Jun 2007 07:00:57 -0400 (EDT)
On 6/17/07 at 6:12 AM, diana.mecum at gmail.com (Diana) wrote: >I am trying to convert a list of numbers, such as: >{4, 5, 10, 11, 3, 79, ...} >to a two column text file such as: >1 4 2 5 3 10 4 11 5 3 6 79 ... >Let me use the following example. Assume that I have defined an >"r[n_]" function of arbitrary integers. >tt = Flatten[Prepend[Table[Numerator[r[n]], {n, 4, 100}], {1, 1, >5}]] >tttable = Table[{j, tt[[j]]}, {j, 1, Length[tt]}] >Export["sequence.txt", tttable] >I get an output line of "sequence.txt", but then can not find the >file. Right after you do Export do Directory[] This will return the working directory Mathematica used to Export your file. If you want to have the file written to a particular directory, either use SetDirectory to set the working directory before using Export or include the directory you want used in the Export command. This latter can be done as either Export["C:\\dirname\\sequence.txt", tttable] use ToFileName to build the pathname instead of literally typing the pathname as I did above. Note, I use Mac OSX. So, I may have the pathname separators wrong for Windows. -- To reply via email subtract one hundred and four