MathGroup Archive 2005

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

Search the Archive

Re: Importing (and dealing with) multiple files


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