Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 qlikviewforum
		
			qlikviewforum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi All,
Is there is any optimized way to scan the file system other than using the below code which generates very large log file. Please help!
// 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
 
					
				
		
.png) Bill_Britt
		
			Bill_Britt
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi,
I would once you had everything working like it should, turn off the logs.
Bill
 qlikviewforum
		
			qlikviewforum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi Bill,
Thank you!
We do need logs to be saved for our investigation. So I would like to optimize it by doing some changes in the code and let it saves the log files in the normal way. If I can optimize it then that could be the best way to do it instead of thinking about how to off the logfile.
Though it will not be accepted, please let me know how to turn off the logs if everything it working file. I am not sure how to do that.
Thanks
 
 DavidFoster1
		
			DavidFoster1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		isnt the end sub on the wrong line? Shouldn't it be on line 12?
 DavidFoster1
		
			DavidFoster1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		document properties -> general tab -> generate logfile flag
 qlikviewforum
		
			qlikviewforum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		No, it will be there only.
 qlikviewforum
		
			qlikviewforum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		I know this properties but is there is anyway where we can generate the log file only when the application fails. This is what my question was!
 DavidFoster1
		
			DavidFoster1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		
There is no way to avoid the logging as it is generated at the same time as the action. It is the individual load statements for each file that will be bloating the log file.
 qlikviewforum
		
			qlikviewforum
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hi David,
Thank you for your response.
Is there is any way to restructure the code in better way to avoid logging and the time it takes to refresh. Some how I need to restructure this code to avoid logging. If not possible to restructure the same piece of code we are ready to switch if the new code doesn't takes much time and have less logging.
I think oneway of optimizing this code is to scan only those files which we are looking for instead of scanning each and every file. For example if we looking for xls file in any of the directory code should be in a such a way that it scans only the xls file instead of scanning csv,jpg and etc...I agree it looks in only for xls file it creates the unnesscary logging if the directory contains other file format like csv,jpg and etc...
Please let me know if you have another alternative for this.
Thanks,
 DavidFoster1
		
			DavidFoster1
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		There is no way to simplify the code any further. I think to meet your requirements you will need to go back to looking at something like DIRUSE to extract the data and then load it into QlikView for analysis.
