Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Loop and Load in LOAD

Hi all,

how can i loop through a directory and load all XLS files stored in this directory ?

I would like to do this in my LOAD script.

Folder structure is like this:

- FOLDER

   - XLS1

   - XLS2

   - XLS3

   (...)

Thanks for some advise.

Regards,

K

1 Solution

Accepted Solutions
alexandros17
Partner - Champion III
Partner - Champion III

Define another path and use it with or condition when you define the condition of the for

View solution in original post

5 Replies
alexandros17
Partner - Champion III
Partner - Champion III

let path_Alles = '..\..\myfile_*.xlsx';

for each File in filelist (path_Alles)

P
alletInfo:

LOAD

*


FROM $(File) (ooxml, embedded labels, table is Display)

Where condition

next File

andreypico
Contributor III
Contributor III

I hope this helps

FOR i = 1 to (count XLS file)

                    LET LoadPath = '(path)\XLS_$(i)&'.xls';

                    If FileSize('$(LoadPath)') > 0 then

                              [t1]:

                              LOAD *

                              FROM

                              $(LoadPath)

(ooxml, embedded labels, table is Sheet1)

;

                     ENDIF

NEXT

Not applicable
Author

OK, thanks. And how woulg this work if i have an additional layer of folders ?

Like this:

- ROOTFOLDER

   - FOLDER1

      - XLS1

      - XLS2

   - FOLDER2

      - XLS1

   - FOLDER3

      - XLS1

      - XLS2

Thanks very much!

alexandros17
Partner - Champion III
Partner - Champion III

Define another path and use it with or condition when you define the condition of the for

Anonymous
Not applicable
Author

Can this be done in incremental load way. Mean, if I have already loaded the excel files it should not load again when I re-run this qvw again in future?