I tried to import multiple files at once. Following this topic my code is
files = FileNames["*.phz", NotebookDirectory[]]
neki = Import[#, "Table"] & /@ files
Now this works perfectly fine. To be completely clear my files have names "zug1.phz", "zug2.phz", "zug3.phz" etc... up to "zug25.phz".
Now the problem is that I don't know the order of the imported files. Meaning neki[[1]]
opens a file, but the question is, which one? Ideally neki[[1]]
would open file "zug1.phz". But it doesn't matter, the idea is that I have to know which file is opened or maybe even specify at the Import which file should be under neki[[1]]
.
<| "Name" -> #, "Contents" -> Import[#, "Table"] |> & /@ files
. I don't know about inbuilt ways to do it. $\endgroup$Transpose@{files,neki}
should create filename/data pairs that aligned. $\endgroup$SortBy[files, StringCases[#, (n : NumberString) ~~ ".phz" :> ToExpression@n] &]
$\endgroup$