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: change filename automatically in Export Command

  • To: mathgroup at smc.vnet.net
  • Subject: [mg73882] Re: change filename automatically in Export Command
  • From: Bill Rowe <readnewsciv at sbcglobal.net>
  • Date: Fri, 2 Mar 2007 06:42:52 -0500 (EST)

On 3/1/07 at 6:21 AM, serdal at mail.utexas.edu (serdal kirmizialtin)
wrote:

>Hi All, Does anybody know how to change the name of the file with a
>Do loop in the = Export comand For example I want to name my files
>as a1.png a2.png a3.png ....a1000.png each time I use the following
>command Export["filename",aa1,"PNG"]

>i need to change filename by hand is there a way of doing it
>automatically=

There are a great many ways to achieve changing filenames automatically.

A few of simple ways to do this are:

MapIndexed[Export[a<>ToString[#2[[1]]]<>".PNG,#1,"PNG]&, graphicsList];

MapThread[Export[a<>ToString[#1]<>">PNG", #2, "PNG"]&,
    {Range@Length@graphicsList, graphicsList}]

With these two methods, graphicList would contain the graphic
elements you wanted exported.

With a Do loop the code would would look something like

Do[
   Export[a<>ToString[n]<>".PNG", graph[n], "PNG"],{n, nmax}]
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: Sort with -Infinity fails
  • Next by Date: RE: Sort with -Infinity fails
  • Previous by thread: Re: change filename automatically in Export Command
  • Next by thread: Re: change filename automatically in Export Command