Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am writing a code to get list of all folder contents and one of the file has ' (apostrophe)
File Name Hill's document.qvw
when it read this file in table ,, it show up two apostrophe
Output Hill''s document.qvw
Please help
vRootFolder = '\\Server\E$\QlikView_Docs\Users';
DoDir (Root)
FOR Each Ext in 'qvw'// 'qvd'
FOR Each File in filelist (Root & '\*.' & Ext)
User_Contents:
LOAD
//'$(File)' as Name1,
lower ( mid ( '$(File)' , Index('$(File)','\',-1)+1,Len('$(File)')) ) as [DocName],
'Live Applications' as Live
// 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
ENDSUB
CALL DoDir ('$(vRootFolder)')
Can some one please help?
FOR Each File in filelist (Root & '\*.' & Ext)
Let File=purgechar(File,chr(39)); // cleans apostrophe'
Use a "Load ... Inline" instead. Then it will load the correct file names:
For each vFile in FileList('Path\*.txt')
LOAD
FileName,
FileSize(FileName) as Size,
FileTime(FileName) as FileTime
inline
[FileName
$(vFile)];
Next vFile
HIC
Thanks ,, it worked for me.. is this a bug?
( mid ( FileName , Index(FileName,'\',-1)+1,Len(FileName)) ) as [FileName]
Inline
[FileName
$(File)];
Why Name below brings two apotrophe if file has one apostrophe? like I have Hill ' s , it returns Hill ' 's
Each File in filelist (Root & '\*.' & Ext)
User_Contents:
LOAD
'$(File)' as Name,