Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
olivierrobin
Specialist III
Specialist III

Scan of scripts in .qvw files

Hi,

is it possible to scan script in all .qvw files to search a specific string ?

3 Replies
giakoum
Partner - Master II
Partner - Master II

If you export all the scripts first in some directory as qvs files (kind off like text files)

Not applicable

Hi Olivier, There are couple of options. Reading the qvw script from Log file generated after qvw reload or export the qlikview script .qvs files into  one directory. For scanning you need to write the batch file or vbs file.

marcus_sommer

Here a possibility to scanning scripts through a macro - in this case with writing in a text-file, but you could check each script-part with a instr() to your search-string.

set doc = ActiveDocument
set obj = doc.GetSheetObject("TB04") 'Tabellenbox der Anwendungen

for iRow = 1 to obj.GetRowCount - 1 'von Zeile 1 bis zur letzten Zeile
     set app = obj.GetCell(iRow, 0) 'applications
     set path = obj.GetCell(iRow, 1) 'path
     set newApp = ActiveDocument.GetApplication 
     set newdoc = newApp.OpenDoc (path.Text & "\" & app.Text,"","")
     set prop = newdoc.GetProperties

     script = prop.Script 'LoadScript Variable zuweisen
     set fso = CreateObject("Scripting.FileSystemObject") 'FileSystemObject erstellen
     set File = fso.OpenTextFile(FilePath & "\LoadScripte\" & "LoadScript_" & app.Text & stamp & typ, 2, true) 'txt-File schreibend öffnen           
     File.Writeline script 'Variable in txt-File schreiben
     File.Close 'txt-File schließen
next

- Marcus