MathGroup Archive 2008

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

Search the Archive

Re: Automating file names in exporting data

  • To: mathgroup at smc.vnet.net
  • Subject: [mg92533] Re: Automating file names in exporting data
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Fri, 3 Oct 2008 06:40:54 -0400 (EDT)
  • Organization: University of Bergen
  • References: <gc3j1v$s77$1@smc.vnet.net>

Ivan wrote:
> Hi,
> 
> I have a table of data with and I want to write them to different
> files with associated file names
> "x<i>.dat"
> where <i> is the label for the column.
> 
> My question is how do I write the Export command so that I can iterate
> the name of the file with For loop for example.
> 
> thanks in advance
> Ivan
> 

Something along these lines will do it:

MapIndexed[
   Export["x" <> ToString@First[#2] <> ".dat", #1, "Table"] &,
   tableOfData
]


  • Prev by Date: Re: Comparison between Mathematica and other symbolic systems
  • Next by Date: Re: how to get rid of extra parentheses ?
  • Previous by thread: Automating file names in exporting data
  • Next by thread: Re: Automating file names in exporting data