Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to extract some information from a filelist created with the 'for each Datei in filelist' statement.
The table TempFolder is created and the field 'QVDPathName' contains the complete path and the filename
with the extension.
If I try to extract the simple filename with the FileBaseName function, I'm getting only a blank field.
The 'QVDCreateTime' function works properly!
for each Datei in filelist('$(vPath)' & 'QDatei*.QVD')
TempFolder:
Load
'$(Datei)' as QVDPathName
Autogenerate 1;
Folder:
Load
FileBaseName(QVDPathName) as QVDName,
QvdCreateTime(QVDPathName) as QVDDatum
resident TempFolder;
next
Any ideas, where the problem is?
Michael
Hi Michael,
is FileName() working?
- Ralf
Hi
Use FileBaseName without parameters like: FileBaseName()
It returns the base name of the file currently being loaded.
Regards
Jonathan
Hi Ralf,
no FileName() is also not working. Maybe it is an issue of my installed version. Actually I'm using V10SR3.
I've initiated to update to the latest version.
Michael
Hi Jonathan,
FileBaseName() without parameters is also not working. Maybe an issue of the version. See my earlier post.
Michael
Hi
OK, I see the problem. FileBaseName() only works in a load statement loading from a file (qvd, txt, xls etc) and does not work from a resident load or a database load. You are using it in a resident load and it will not work because it gets the base file name of the file being loaded.
Your best bet is to move the FileBaseName() to the TempFolder load. You can then fetch the basename from the temp folder in the second load
Regards
Jonathan
Oh, and change the Autogenerate 1 to From [$(Datei)];
ie:
LOAD FileBaseName() As QVDName
FROM [$(Datei)];