| Author |
Comment/Response |
Xavier
|
09/29/08 07:00am
Hey,
Yes there is. Let's say you want to work on some files and all these names are stored in a list named myFiles. You have many possibilities to make the imports automatic:
1) Map[ Import[#]&, myFiles ]
=> it will import them the one after the other and the result of this command is the list of the contents of your files. If the names are not strings, replace # with ToString[#], but be careful there is no space within the names of the files!!!
2) If your files are numbered, like A1, A2, ..., it may be simpler to directly work with the head A:
Map[ Import["A"<>ToString[#]]&, Range[Length[myFiles]] ]
3) If you have really weird file names or if I missed the point of your question, this kinda method may work if myFiles contains strings:
Map[ ToExpression["Import[\""<>#<>"\"]"]&, myFiles]
I hope it helps. If it does not answer your question (I have some problems in English), please let me know.
Cheers,
Xavier
URL: http://zavou.zxr.fr, |
|