Re: Beginner--how to import a series of files?
- To: mathgroup at smc.vnet.net
- Subject: [mg63838] Re: [mg63833] Beginner--how to import a series of files?
- From: "David Annetts" <davidannetts at aapt.net.au>
- Date: Wed, 18 Jan 2006 02:39:07 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi, > Now I have a series of raw data, such as image_1.raw, > image_2, ..., etc. > I plan to import all of these files and make some post-processing. > How do I do it? Is there any special command or I need to > write a script to perform? > Thanks for your time. No problem. You can get your list of files using SetDirectory[ working dorectory ]; ifiles = FileNames["*.raw"] And import them using data = Import[#, Options]& /@ ifiles; If your files aren't in a format that import knows about, you need to write a function to deal with them, in which case you can still use data = myImport[#, Options]& /@ ifiles; Writing your own function might be straightforward depending on what is actually in the files (you haven't posted an example), or it might not be. In any case, Horton et al gave a paper on Import (& Export) at the 2003 Developer's conference (look for it on MathSource) that might give you some ideas if your data are in a particularly interesting format. Regards, Dave.