Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements

Breathe easy -- you now have more time to plan your next steps with Qlik!
QlikView 11.2 Extended Support is now valid through December 31, 2020. Click here for more information.

montubhardwaj
Valued Contributor

How to read LOG files inside a specific folder and not it's subfolder

Hi All,

I am using the below mentioned code to read QV log files from folder.

Sub DoDir (Root)

//for each Ext in 'qvw', 'qvo', 'qvs', 'qvt', 'qvd'
for each Ext in 'log'

for each File in filelist (Root&'\*.' &Ext)

FilesName_Temp1:
Load '$(File)' as Name

autogenerate 1;

next File

next Ext

for each Dir in dirlist (Root&'\*' )

call DoDir (Dir)

next Dir

end sub


Set LogEnviron='Production';
call DoDir ('\\production\d$\QV App') ;

FilesName_Temp2:
Load Left(Name,-1) as Name1
resident FilesName_Temp1;

There are subfolder under "QV App" folder from where I am reading the logs. It is working fine but the problem is this cose is pulling all the log files from subfolders also. I specifically want to pull only from "QV App" folder and not from subfolders.

Any suggestions?

Thanks in advance.

Regards,

Sharma

1 Solution

Accepted Solutions
montubhardwaj
Valued Contributor

How to read LOG files inside a specific folder and not it's subfolder

Hi Dnatividad,

Thanks much. It worked. I completely missed this. Thanks again.Smiley Happy

Regards,

Sharma

2 Replies
darwin_nativida
Contributor

How to read LOG files inside a specific folder and not it's subfolder

I think you have to comment this out.

//for each Dir in dirlist (Root&'\*' )

//          call DoDir (Dir)

//next Dir

montubhardwaj
Valued Contributor

How to read LOG files inside a specific folder and not it's subfolder

Hi Dnatividad,

Thanks much. It worked. I completely missed this. Thanks again.Smiley Happy

Regards,

Sharma