Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Below I've enclosed the example script from QlikView help. This function lists all files in certain location (in this case on drive C:). But it's very sensitive to one thing:
Your's_best_file.qvw
This file contain an apostrophe , which causes error during the execution of this function, when this file will be found. Unfortunelly I have no idea what to do with it.
If anybody can help me, it would be very kind of you.
************************************************************************
[ code ]
// list all QV related files on disk
sub DoDir (Root)
for each Ext in 'qvw', 'qva', 'qvo', 'qvs'
for each File in filelist (Root&' \*.' &Ext)
Load '$(File)' as Name, FileSize( '$(File)' ) as
Size, FileTime( '$(File)' ) as FileTime
autogenerate 1;
next File
next Ext
for each Dir in dirlist (Root&' \*' )
call DoDir (Dir)
next Dir
end sub
call DoDir ('C:')
[/ code ]
I would change the name of the file; apostrophes in file names are not permitted. Can it not be changed?
Well the problem is that it cannot be changed. Maybe there is another way ?
Pawel,
the problem is caused by the statement where $(File) is enclosed in a set of single quotes, and the structure all together doesn't work. Try the following code, it "MIGHT" work, because $(File) is not wrapped in quotes:
Main:
Load
Name,
Right(Name,Len(Name)-Index(Name,'\',-1)) AS File,
FileSize(Name) as Size,
FileTime(Name) as FileTime,
date(subfield(FileTime(Name),' ',1),'M/D/YY') as FileDate,
year(FileTime(Name)) as FileYear;
Load * Inline [
Name
$(File)] ;