I have 101 files with data that I want to import into Mathematica. All the file names are numbered as follows datafile.20.0000.out, datafile.20.1000.out, datafile.20.2000.out and so on. I used the solution posted here Importing multiple files using a for-loop
However, the problem I am facing is the zeros at the end. I tried using
z = Table[i, {i, 20, 30, 0.1}]
Data =
Table[
Import["C:\\Dropbox\\Sims\\datafile." <>
ToString[NumberForm[z[[j]], {6, 4}]] <> ".out", "Data"],
{j, 20, 30, 0.1}]
But I'm getting error messages.
I would like to retrieve date of each file by Data[[20]], Data[[20.1]] and so on.
datafile.20.0000.out? so what is the last file full name? is itdatafile.20.1010.out? You can't have an index that is not discrete. So index 20.1 will not work. – Nasser Oct 09 '14 at 04:35Data[[20.1]]is invalid syntax, list indices must be integers. – m_goldberg Oct 09 '14 at 04:37