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.

marcorizzo
New Contributor III

export script into txt file

Hi everybody.

I've got this need.

I would like to export all the script of my qlikview file into a txt file.

What do you suggest me ?

Thanks

1 Solution

Accepted Solutions
felipedl
Valued Contributor III

Re: export script into txt file

Forgot to mention that the script is generating the file into "C:\Script\Test.txt"

You have to create the folder or change it in the macro section in qlivkiew "Tools -> Edit Module";

Use the attached QVW.

Felipe.

11 Replies
marcorizzo
New Contributor III

Re: export script into txt file

Is there a command in the script that I can use in the top of the script for my need ?

felipedl
Valued Contributor III

Re: export script into txt file

Hi Marco,

When you enter the script editor (CTRL+E), theres an option, under File -> Export to Script File that makes what you need.


This will export it to a qvs file or txt.

Felipe.

marcorizzo
New Contributor III

Re: export script into txt file

Nice but I'd like to automatize this operation.

Is there a syntax that I can use in the top of the script to export the whole script below ?

P.S. Sorry for my English

felipedl
Valued Contributor III

Re: export script into txt file

Hi Marco,

See the attached QVW.

It uses a macro, as follows:

sub writeScriptToFile

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objFile = objFSO.OpenTextFile("C:\Users\eferibe\Desktop\Test.txt", 2,True)

objFile.Write(ActiveDocument.GetProperties.Script)

objFile.Close()

end sub

You can create a task (if you have Qlik Server) to automate the task.

Felipe.

marcorizzo
New Contributor III

Re: export script into txt file

What do you think if the txt result is this:

///$tab Main

???

felipedl
Valued Contributor III

Re: export script into txt file

It's a comment that's just stating in which tab it is.

I've added two more tabs, and it's the same for the others, so you can differentiate between the tabs in Qlikview.

It's just a tag actually.

Felipe.

Not applicable

Re: export script into txt file

Hi Marco,

Try this Macro, you should change the path used in the variable.

After saving the macro, you can create a button to execute it.

felipedl
Valued Contributor III

Re: export script into txt file

Forgot to mention that the script is generating the file into "C:\Script\Test.txt"

You have to create the folder or change it in the macro section in qlivkiew "Tools -> Edit Module";

Use the attached QVW.

Felipe.

marcorizzo
New Contributor III

Re: export script into txt file

which is the variable I have to change ?

Thanks