Wolfram Mathematica import data from multiple files
import, string, wolfram-mathematica
Solution
You can use `FileNames` to collect the names of the data files you want to import, with the usual wildcards.
And then just map the `Import` statement over the list of filenames.
`data` will then contain a list comprising the data from each file as a separate element.
data = Import[#,"Table"]& /@ FileNames["~/math/third_ks/mixed_matrices/*.dat"];
Problem
I have a lot of files. Every of which contains data. I can happy import one file to Mathematica. But there are more than 500 hundreds of files. I do it so: ``` Import["~/math/third_ks/mixed_matrices/1.dat", "Table"]; aaaa = % (*OUTPUT - some data, I can access them!*) ``` All that I want is just to make circle(I can do it), but I cannot change name of file - 1.dat. I want to change it. I tried to make such solution. I generated part of possible names and I have written them to separated file. ``` Import["~/math/third_ks/mixed_matrices/generate_name_of_files.dat", "Table"]; aaaa = % ``` Output: `{{"~/math/third_ks/mixed_matrices/0.dat"}, \` `{"~/math/third_ks/mixed_matrices/1.dat"}, ......` All that I want to do is `Table[a=Import[aaaa[[i]] ,{i,1,500}]` But the function `Import` accepts only `String` " " objects as filename/paths.