Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
i want to load always all tables from a directory, even if there new tables or tables were deleted.
This is an example for a folder structure:
MainFolder
SubFolderr1
File1
File2
SubFolder2
File3
File4
SubFolder3
File5
File6
How can i load always all tables from MainFolder regardless of new filename´s or files wich were deleted?
regards,
Fritz
If you are using server version of Sense be careful with connection name, because the user name will be automate concatenate to connection name like this: lib://connection name (user name).
The user name is deletable from QMC.
Hope this help.
G.
I did it like you describe. I get always this error:
Error: File extdata.cpp, Line 2279: FileList: Concatenate LOAD *,...
But only if i load a xlsx file. If i load a csv file it works.
For csv i use this code:
FROM [$(Datei)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 2 lines);
For xlsx this code:
FROM [$(Datei)] (ooxml, embedded labels, table is test));
regards,
René
This script runs:
Set vConcatenate = ;
sub ScanFolder(Root)
for each FileExtension in 'csv','xlsx'
if FileExtension = 'csv' then
for each Datei in filelist( Root & '\*.' & FileExtension)
FileList:
$(vConcatenate)
LOAD *, '$(Datei)' as SourceFile
FROM [$(Datei)] (txt, codepage is 1252, embedded labels, delimiter is ',', msq, header is 2 lines);
Set vConcatenate = Concatenate;
next Datei
elseif FileExtension = 'xlsx' then
for each Datei in filelist( Root & '\*.' & FileExtension)
FileList:
$(vConcatenate)
LOAD *, '$(Datei)' as SourceFile
FROM [$(Datei)] (ooxml, embedded labels);
Set vConcatenate = Concatenate;
next Datei
end if
next FileExtension
for each SubDirectory in dirlist( Root & '\*' )
call ScanFolder(SubDirectory)
next SubDirectory
end sub
Call ScanFolder('C:\work');
Hi Walter,
Add an excel from wizard, then copy that code from it.
FROM [$(Datei)] (ooxml, embedded labels)
It could be more parameter, like table name, how many rows should be skipped.
It can be different columns in files. XLSX may have @A @B .. columns due to the used columns property of workbook.
I suggest you run your script at debug mode, and dwelve into your files.
G.