
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DirList() and FileList()
Hi experts,
Can someone explain me haw these functions work and what is their syntax? I am really confused how to use them, I looked at the reference manual and I tried something like this:
For each Ext in FileList('C:\Users\Gabika\Desktop\*.x*')
Main:
LOAD
'$(vFile)' as File
AutoGenerate (1);
Whatever I tried write in bracket, the result is still: c:\Program Files\QlikView\Themes\Wind.qvt
Thank you for your answer.
- Tags:
- qlikview_scripting
- « Previous Replies
-
- 1
- 2
- Next Replies »
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Root is just a parameter of such sub, which defines where your search will start from. When you invoke this sub, you use C:\ as root, which means you will search those files from C:\ and its sub-folders.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Find example from ref. manual.
// example 2 - list all QV related files on disk
sub DoDir (Root)
for each Ext in 'qvw','qvo','qvs','qvt','qvd'
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:')
Vikas
If the issue is solved please mark the answer with Accept as Solution & like it.
If you want to go quickly, go alone. If you want to go far, go together.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I looked at it, but I do not understand it. I need to explain it. Mainly I do not understand syntax in bracket.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
First we define the extensions we want to look for for each Ext in 'qvw','qvo','qvs','qvt','qvd'
Then we define the directory we want to search, in this case (Root& and then we look for anything with one of the predefined extensions (see above) '\*.'&Ext)
So in this case we would search the computer for anything with these extensions 'qvw','qvo','qvs','qvt','qvd'

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What does root mean? Where is it define?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can someone explain me it ?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Maybe this:
For each Ext in FileList('C:\Users\Gabika\Desktop\*.x*')
Main:
LOAD
'$(Ext)' as File
AutoGenerate (1);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Root is just a parameter of such sub, which defines where your search will start from. When you invoke this sub, you use C:\ as root, which means you will search those files from C:\ and its sub-folders.


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi.
My need is to read directories. I don't care a bout files this time.
Is there a DirName() function or something?
Do I have to pick up the DirName from NameFiles?
What if there is a DirName() empty?
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does anyone know a good source to learn Looping & how to use Qlik's Listing Functions. Thanks

- « Previous Replies
-
- 1
- 2
- Next Replies »