Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Experts,
I have one folder files like
jan1
jan2
jan3
jan4
jan5
jan6
jan7
jan8
jan9
jan10
if i go for reload i need top 5 files data.
Expected output:-
jan5
jan6
jan7
jan8
jan9
jan10
for ex:- when I add jan11,jan12,jan13,jan14,jan15
here i need jan11 to jan15 files data.
Look through to extract the all the filenames in a folder and then put them in a table to find the Max 5 and then may be use Where Exist to only load the latest 5.
Look through idea: Loop through Folders and sub folders to get file names
Something like this maybe
For each File in filelist ('Folder_Path')
Files:
LOAD
'$(File)' as Name,
num#(KeepChar('$(File)',0123456789)) As FileNumber
autogenerate 1;
Next
ReadFiles:
FIRST 5
LOAD
Name as FileName
RESIDENT
Files
ORDER BY
FileNumber Desc
;
For i = 1 to 5
LET vFile = peek('FileName',$(i),'ReadFiles')
LOAD * FROM $(vFile) (qvd);
Next
If you're not loading from qvd files then change (qvd) to the correct format specification for the type of source file you're using.