Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I'm trying to load all qvds in the given folder which have timestamp greater than the date i give:
Example
If my date given is 20160915, then i wanna load all qvds greater than 20160915 (this is the time stamp in the last 8 characters of the filename).
Any help is highly appreciated.
Still have to run a test on this, but you'll get the idea:
LET vPath = 'C:\Temp\';
LET vCutoffDate = '20160915';
LET vCutoffNum = num(MakeDate(left(vCutoffDate, 4), mid(vCutoffDate, 5, 2), right(vCutoffDate, 2)));
FOR EACH vFilePath in FileList('$(vPath)\*.QVD')
LET vFileDate = right(mid(vFilePath, index(vFilePath, '\', -1)+1,
index(vFilePath, '.', -1) - index(vFilePath, '\', -1) -1), 8);
IF (len(vFileDate) = 😎 and (len(Purgechar(vFileDate, '0123456789')) = 0) THEN
IF MakeDate(left(vFileDate, 4), mid(vFileDate, 5, 2), right(vFileDate, 2)) > vCutoffNum THEN
ResidentTable:
LOAD * FROM [$(vFilePath)] (qvd);
END IF
END IF
NEXT
[Edit] Made a few corrections to make it work allright
Do these QVDs have the same layout, e.g. should they be concatenated into the same Resident table?
Yes sir. This is for concatenation into the resident table.
Still have to run a test on this, but you'll get the idea:
LET vPath = 'C:\Temp\';
LET vCutoffDate = '20160915';
LET vCutoffNum = num(MakeDate(left(vCutoffDate, 4), mid(vCutoffDate, 5, 2), right(vCutoffDate, 2)));
FOR EACH vFilePath in FileList('$(vPath)\*.QVD')
LET vFileDate = right(mid(vFilePath, index(vFilePath, '\', -1)+1,
index(vFilePath, '.', -1) - index(vFilePath, '\', -1) -1), 8);
IF (len(vFileDate) = 😎 and (len(Purgechar(vFileDate, '0123456789')) = 0) THEN
IF MakeDate(left(vFileDate, 4), mid(vFileDate, 5, 2), right(vFileDate, 2)) > vCutoffNum THEN
ResidentTable:
LOAD * FROM [$(vFilePath)] (qvd);
END IF
END IF
NEXT
[Edit] Made a few corrections to make it work allright
Thanks Peter!!