2

I have a list of files all indexed as filename1,filename2,filename3,... up to 50, all in the same directory, and I wanted an AppendTo them to a list and ToExpression in index order 1,2,...,50.

Does anyone know of a good method to do this? Thanks!

MKF
  • 591
  • 2
  • 10

1 Answers1

4

You may generate the list of files with

Table[FileNameJoin[{dir,"filename" <> IntegerString[i]}], {i, 1, 50}]

where dir is a string containing the path to said directory.

Henrik Schumacher
  • 106,770
  • 7
  • 179
  • 309