Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I would like to load multiple excel files based on the date of the file
in my example I would like to load all files greater than '20180506'
Your assistance is appreciated.
For each File in FileList('$(Path)\TestFile2018*.xlsx') ;
//For each File in FileList('$(Path)\TestFile'>'20180506*.xlsx') ; I would like to do something like this but this does not work.
Let vFileName=SubField('$(File)','\',-1);
Let vFileDate=Num(Keepchar('$(vFileName)','0123456789'));
If '$(vFileDate)'>20180506 THEN
Data:
LOAD Field1,
Field2,
Field3,
FileName
FROM $(File)(ooxml, embedded labels, table is Sheet1);
END IF
NEXT;
For each File in FileList('$(Path)\TestFile2018*.xlsx') ;
//For each File in FileList('$(Path)\TestFile'>'20180506*.xlsx') ; I would like to do something like this but this does not work.
Let vFileName=SubField('$(File)','\',-1);
Let vFileDate=Num(Keepchar('$(vFileName)','0123456789'));
If '$(vFileDate)'>20180506 THEN
Data:
LOAD Field1,
Field2,
Field3,
FileName
FROM $(File)(ooxml, embedded labels, table is Sheet1);
END IF
NEXT;
Try this
Let Path='';
For each File in FileList('TestFile2018*.xlsx') ;
IF Date#(Left(Right('$(File)', 13), 8), 'YYYYMMDD') > MakeDate(2018, 5, 7) THEN
Data:
LOAD Field1,
Field2,
Field3,
FileName
FROM $(File)(ooxml, embedded labels, table is Sheet1);
ENDIF;
NEXT;