Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Sam.DHi there,
I am trying to build a chart that can be future proofed. The scenario is this, I have a directory which contains a number of excel files, the excel files can have between 1-4 sheets populated. The columns 'should' always be identical on the sheets and the files.
I can import the excel files one by one and specify the number of sheets in each then merge them into a single output, but the folder is dynamic meaning that files can be added or removed at any given time. Because of this I would like some way to identify all the files in the directory then store an array of file names for files matching a string, once I have the list of filenames I want to extract the data and concatenate it.
Using pseudocode:
CheckFileNameStr="MyFile"
Dir="MyPathtoFiles"
DataSet=nothing
Open $Dir
FileList=find files where CheckFilNameStr in $Dir\fileList
Foreach file in Filelist
open file
x=1
if sheet $x exists and contains data
append data to DataSet
else
next file
increment x
next sheet
Does anyone know whether this is possible in brainscript/lavastorm? Any pointers or examples are appreciated.
Thanks