Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I receive files with different extension and for this reason I should manually resave a lot of files in nessecerary extension.
How can determine this using qlikview?
You could write a batch file that deals with managing the files.
You can run the batch file in the qlik script run by e.g.
EXECUTE CMD /C D:\...\MyBatchFile.bat;
you could probably do a code like below:
// 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
ENDSUB
CALL DoDir ('C:')
or this one:
Load *, fileextension( ) as X from
C:\UserFiles\abc.txt
Will return 'txt' in field X in each record read.
This one works,
LET vfile_Path = 'C:\Users\jpenuliar\Desktop\Reports Management\files here\';
Sub GetFilesInFolder(Root)
For Each File in FileList(Root & '*.*')
[Production Reports Table]:
Load
'$(File)' as File_Name,
subfield('$(File)', '.', -1) as FileExtension,
FileSize('$(File)') as Size,
FileTime('$(File)') as File_Time
AutoGenerate 1;
Next File
End Sub
Call GetFilesInFolder('$(vfile_Path)')