Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Script from Logfile

Hi All,

Is there any way to get script of qlik app from its logfile? if possible please suggest.

12 Replies
olivierrobin
Specialist III
Specialist III

hello

you can have part of it.

everything outside a loop OR not containing substitution variable is ok

BUT

as it is a log, all loops are executed n times ans traced

and substitution variables are expanded

for 2 those 2 parts, you have to rewrite the original code by analyzing loops

Anonymous
Not applicable
Author

Hi Thanks for the reply.but how do we remove the date and timestamp which is a part of log file and also log file is of text format.pleaee suggest

olivierrobin
Specialist III
Specialist III

you can use Notepad++ for example and its column mode to remove the first columns of the row

after that, you copy all the text and paste it into qlikview script editor

Peter_Cammaert
Partner - Champion III
Partner - Champion III

To cut the timestamp from the front of a log file, see Olivier Robin's suggestion: Re: Script from Logfile

A Load script is always text, whether embedded inside a QVW document, or as content of an external script file. When you finished formatting and cleaning up your source, either copy the resulting text block in the script editor of a new document, or save the result as a .qvs file and $(Include=...) it in your target document.

Anonymous
Not applicable
Author

Is there any way to do that in qlikview itself without using notepad++.

olivierrobin
Specialist III
Specialist III

you can paste all in Qlik and use Qlik Editor to remove date ans tile from eache line

but it wont't be as easy as with Notepad++

Anonymous
Not applicable
Author

Thanks Olivier.

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Yes, there is and it is extremely easy (and rather funny)

Under the motto "You can use QlikView for (almost) anything", create a new document, open script editor and create a LOAD statement for your log file as a fixed width source file. Something like:

ScriptLines:

LOAD RecNo() AS LineNo,

     [@27:n] AS ScriptLine

FROM [YourLogFile.log] (fix, unicode);

Reload and place a Table Box on the Main sheet with two columns and sort according to LineNo to get the correct order. Check whether everything is correctly read and correct your LOAD options where needed.

You may want to skip the first 24 lines (check first, it may be different for your version of QV Desktop)

Then use a STORE statement to write back to a .qvs file.

Note that you'll still need to remove (probably manually) the table load comments and one or more terminating lines ("Execution finished")

olivierrobin
Specialist III
Specialist III

be careful with the limit at 27. in QV12, line numbers may be shifted to the right when if a if of for strucutre

example behind :

  2018-03-21 10:31:05 0023 NEXT j

  2018-03-21 10:31:05 0024

    2018-03-21 10:31:05 0017 FIELD_LIST:

    2018-03-21 10:31:05 0018  LOAD

    2018-03-21 10:31:05 0019  TableName(0) as TableName,

    2018-03-21 10:31:05 0020  FieldName(4,TableName(0)) as Champs

    2018-03-21 10:31:05 0021  AutoGenerate 1

    2018-03-21 10:31:05