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.