Choose Language Hide Translation Bar
Community Member

iterate through excel files in a directory

I started working on a script to iterate through excel files in a directory, extract data from a specific field within each file and populate a different excel file with the data from all the excel files in the directory.

I am only interested in excel file names with a certain length so I started with the script below. The typical excel name file length is xxxxxxxxxxxx.xlsx (length = 12 before the .xlsx) and is unique.

files = ("file location");

keep = For( i = N items(files), i >= 1, i--,

  If( length(files)> 12 ),

  Remove From( files, i)


I keep getting an error. Any suggestions?

0 Kudos