Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello all,
I'm running a filelist loop to load all files in a folder, and I'm getting a file not found error in the middle of the file list loop. I'm not understanding what is causing this as it loads the first however many files, and then stops at a specific file. It seems to find the file and then tell me the file doesn't exist. What's going on here?
=====ERROR TEXT=========================
File not found error
Cannot open file: '\\DummyPath\2019-12-31\2020_01_17\USGL178I_DummyName_2019-12-31.xlsm
(ooxml, embedded labels, header is 7 lines, table is Sheet1)
Where F2 = Ceded Written Premium;
//LOOP CONTENTS DELETED
'
System error: Filesystem::FindEx non existing dir \
=========================
Set MainPath = '\\DummyPath\Dummy2';
For Each Month in '\2019-12-31\2020_01_17','\2019-11-30\2019_12_13'
Let Path = '$(MainPath)'&'$(Month)';
Set vCounter = 0;
For each file in filelist ('$(Path)'&'\*178I*.xlsm')
Let vCounter = vCounter+1;
//Start File Loop
TEMP:
LOAD
Num(F32,'0000000') as MCC,
Month(Date#(Right(FileBaseName(),10),'YYYY-MM-DD'))&'-'&Year(Date#(Right(FileBaseName(),10),'YYYY-MM-DD')) as AcctngMonth
FROM
$(file)
(ooxml, embedded labels, header is 7 lines, table is Sheet1)
Where F2 = 'Ceded Written Premium';
Added [ ] around the dollar sign expansion and the problem seems to be fixed
LOAD * FROM [$(file)]
opposed to
LOAD * FROM $(file)
Added [ ] around the dollar sign expansion and the problem seems to be fixed
LOAD * FROM [$(file)]
opposed to
LOAD * FROM $(file)