Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2009

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

Search the Archive

Re: Use of names

  • To: mathgroup at smc.vnet.net
  • Subject: [mg99927] Re: Use of names
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Tue, 19 May 2009 06:47:31 -0400 (EDT)

On 5/18/09 at 6:18 AM, alain.mazure at oamp.fr (Alain Mazure) wrote:

>I would like to import files from   directories (e.g .png files)
>The names are not always the same but the extension is.

>I could find them by the command:

>FileNames["*.png"]

>which gives  their names, but how could I import all of them since
>the =

>command :

>Import["TEMPO_*.png"]

>does not work in Mathematica

Right. Import does not do wild card expansion nor does it accept
a list of file to be imported. The solution is to use FileNames
to to the wild card expansion and Map to map Import to each of
the files. That is:

Import/@FileNames["*.png"]

will import each of the png files in the current working directory.




  • Prev by Date: Re: Solve a couple mode equation with Mathematica.
  • Next by Date: Re: "SelectionData" and palettes
  • Previous by thread: Re: Use of names
  • Next by thread: Re: Use of names