Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2012

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

Search the Archive

Re: Import multiple files with same extension from a folder

  • To: mathgroup at smc.vnet.net
  • Subject: [mg128236] Re: Import multiple files with same extension from a folder
  • From: David Annetts <david.annetts at iinet.net.au>
  • Date: Thu, 27 Sep 2012 22:49:08 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-newout@smc.vnet.net
  • Delivered-to: mathgroup-newsend@smc.vnet.net
  • References: <20120927070449.4F2086837@smc.vnet.net>

Hi Dominik,

SetDirectory["data/file/directory"];
ifiles = Filenames["*.exp"];
idata = Import[#, "Filetype"]& /@ ifiles;

will import all the .exp files in a particular directory.

Depending on the content of these files, you'll need to modify 
"Filetype".  Some suggestions are "Text" or "Matrix".

Regards,

Dave.

On 27/09/2012 15:04, Dominik Hezel wrote:
> Hello,
>
> I have a folder with different files, e.g.
>
> test1.exp
> test2.exp
> test1.log
> test2.log
> ...
>
> The number of files and actual file names is unknown. I would like to import all files ending with .exp. How do I do this rather simple task?
>
> Thanks for any help.
>




  • Prev by Date: Re: Import multiple files with same extension from a folder
  • Next by Date: Reduce command Mathematica
  • Previous by thread: Import multiple files with same extension from a folder
  • Next by thread: Re: Import multiple files with same extension from a folder