Trying to figure this out.. would be great if someone can assist please. I suspect its probably where the 'if' is placed.
So the theres a folder created which is named a date every day, except on weekends and holidays. It is across countries so public holidays and weekends differ so i cant use weekday or weekend. I basically need to loop through all files in a folder directory, if that days folder exists, then import the file, if it doesnt move to the next day without raising an error in the script execution.
(im sorry its not colour code we have restrictions and i had to type all this out again)
let varDays = num#(today() - date#('01/04/2015','DD/MM/YYYY'));
FOR i=0 to varDays
let vSuffix = Date (today() - varDays + i, 'YYYY-MM-DD');
let vSuffix2 = Date(today() - varDays + i, 'YYMMDD');
let vSuffix3 = Date(today() - varDays + i,'DD-MM-YYYY');
LOAD MakeDate ($(vSuffix3),'DD-MM-YYYY') as Date,
Field1 as Field1
Trace $(i) - $(vSuffix);
I need to add this in to check if the folder exists:
If FileTime('k:\DUMMYFOLDER\$(vSuffix)) > 0 then
RUN the CODE above
else ignore the error, increment the date and continue the loop....