Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Importing (and dealing with) multiple files

  • To: mathgroup at smc.vnet.net
  • Subject: [mg60789] Re: Importing (and dealing with) multiple files
  • From: albert <awnl at arcor.de>
  • Date: Thu, 29 Sep 2005 05:40:56 -0400 (EDT)
  • References: <dhdbdh$8f3$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

hi,

>  I tried using FileNames[] to
> get the list of files, assigning them to an array, then using Import[]
> on each of those array elements.  It didn't work.
> 
> Does anyone have any suggestions?

My suggestion would be to do exactly what you said did not work for you.
This should give you a list containing all data:

SetDirectory["your/data/directory"];
alldata = Map[ImportFileNames["*.ASC"]]

If the datafiles are large, it might be better to extract the relevant data
instead of store their contents in a list:

SetDirectory["your/data/directory"];
resulttable = Map[
Function[{filename},yourextractionfunction[Import[filename]]],
FileNames["*.ASC"]
]

If that doesn't work, you should give details about what goes wrong and I'm
sure you will get help to get this running...

cheers,

albert


  • Prev by Date: Re: N-nested For loops, with N variable - Best way to implement?
  • Next by Date: Re: question about HoldForm
  • Previous by thread: Re: Importing (and dealing with) multiple files
  • Next by thread: Re: Importing (and dealing with) multiple files