- #1
ChristinaJ
Gold Member
- 35
- 1
Hi,
I'm trying to import multiple files into Mathematica. Each file is a 2d matrix and I would like to import multiple files into a nested list. So far I have something that only allows me to load a single file.
In:= SetDirectory["/directory"];
In:= filenames = FileNames[]
Out:= {file1,file2,file3, ...}
In:= loaddata[filenumber_] := Import[Part[FileNames[], filenumber]]
I have a strong suspicion that this is very simple but I just can't see the answer.
Thanks in advance for any help,
Christina
I'm trying to import multiple files into Mathematica. Each file is a 2d matrix and I would like to import multiple files into a nested list. So far I have something that only allows me to load a single file.
In:= SetDirectory["/directory"];
In:= filenames = FileNames[]
Out:= {file1,file2,file3, ...}
In:= loaddata[filenumber_] := Import[Part[FileNames[], filenumber]]
I have a strong suspicion that this is very simple but I just can't see the answer.
Thanks in advance for any help,
Christina