Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I use in my script following code:
let vDataFolder = '\Clients\Current';
FOR each vFile in Filelist ('$(vDataFolder)\Data*.xls')
In current folder I have four files, but parser loads only first file.
Also I add 'Next vFile' in the end of script, but this didn't help.
Hi
The For Each must be associated with a Next to mark the end of the loop.
FOR each vFile in Filelist ('$(vDataFolder)\Data*.xls')
Data:
LOAD .... FROM $(vFile) (biff, ...)
Next
If the files have identical field lists, they will auto-concatenate into a single result table.
HTH
Jonathan
Hi,
can you identify any difference between your files? Do their names all begin with that word "Data" - the rest shouldn't matter as you have an * - and are they all in .xls format?
That code you have should work. When you go through it in the Debugger, does that vDataFolder evaluate to a correct file_path?
Best regards,
DataNibbler
Hi!
It should work:
SET vDataFolder = 'C:\Clients\Current';
For each vFile in filelist ('$(vDataFolder)\Data*.xls')
[File]:
LOAD *
FROM
[$(vFile)]
(ooxml, embedded labels, table is Plan1);
Next vFile;
Hope it helps.
Gabriel
Hi
The For Each must be associated with a Next to mark the end of the loop.
FOR each vFile in Filelist ('$(vDataFolder)\Data*.xls')
Data:
LOAD .... FROM $(vFile) (biff, ...)
Next
If the files have identical field lists, they will auto-concatenate into a single result table.
HTH
Jonathan
Yes, they have the same extansion and all names begin from "Data". Maybe reason, that I have different "sub-load" for each these files, because they have the same data, but this data in different columns.
Scripts structure:
First (1) TAB :
let vDataFolder = '\Clients\Current';
FOR each vFile in Filelist ('$(vDataFolder)\Data*.xls')
(2)
IF (x= a) then
Load Data
(3)
Else if (x= b) then
Load Data
(4)
Else then
Load Data
(5)
NEXT vFile;
Hi,
is that IF THEN structure you have inside your loop also properly closed with an ENDIF?
The columns should actually not matter if you load via field_names and the names are the same between the files.
Best regards,
DataNibbler