Qlik Community

QlikView Scripting

Discussion Board for collaboration on QlikView Scripting.

Announcements
QlikView Fans! We’d love to hear from you.
Share your QlikView feedback with the product team… Click here to participate in our 5-minute survey.
Rules, plus terms and conditions, can be found here.
olivierrobin
Valued Contributor II

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
Honored Contributor II

Re: Scan of scripts in .qvw files

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

Not applicable

Re: Scan of scripts in .qvw files

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.

Re: Scan of scripts in .qvw files

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

Community Browser