Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
gidon500
Creator II
Creator II

Store to txt file encoding ansi

Hello

I am using this script

aa:
LOAD * INLINE [
F1
1
2
3
4
]
;

STORE * from aa into aaa.txt (txt) ;

setting is:  

default export encoding is ansi  in document properties

default user setting is Encoding ansi

the problem is that the aaa.txt file encoding is UTF-8

I need it ansi .

what am I doing wrong  ?

thanks

gidon

1 Solution

Accepted Solutions
Miguel_Angel_Baeyens

The STORE command in QlikView always produces UTF8 encoded files. If you need a different encoding you will need to do it via macro (credit to chriscammers) or out of QlikView, with a command line program you can call from the script using EXECUTE, for example.

View solution in original post

11 Replies
Miguel_Angel_Baeyens

The STORE command in QlikView always produces UTF8 encoded files. If you need a different encoding you will need to do it via macro (credit to chriscammers) or out of QlikView, with a command line program you can call from the script using EXECUTE, for example.

YoussefBelloum
Champion
Champion

Hi,

Store command use only UTF format.

for other formats you must use Macros

gidon500
Creator II
Creator II
Author

thanks

gidon500
Creator II
Creator II
Author

thanks

gidon500
Creator II
Creator II
Author

Hi

I am using this macro

Sub ExportToTextfile

    Set tableObject = ActiveDocument.GetSheetObject("TB19")

    tableObject.Export "C:\Users\Gidon\Desktop\New folder\TEST.txt",Chr(9) 

End  Sub

it works great but how can I store without the lables  .

thanks

gidon

gidon500
Creator II
Creator II
Author

Hi

I am using this macro

Sub ExportToTextfile

    Set tableObject = ActiveDocument.GetSheetObject("TB19")

    tableObject.Export "C:\Users\Gidon\Desktop\New folder\TEST.txt",Chr(9) 

End  Sub

it works great but how can I store without the lables  .

thanks

gidon

Miguel_Angel_Baeyens

With that script, you cannot, because you are calling an object (TB19) which does not exist at the time of loading the script.

Instead you will need to create a table in the script itself which contains all the data you want to save with that encoding. Then you use the Call function:

TableToAnsi:

LOAD *

RESIDENT Othertable;

Call ExportToTextfile(); // the macro stores the results of the table "TableToAnsi" into the TXT file.

// more script here

What I have seen more often is to first STORE the file as TXT which is UTF8 and then use the macro call to convert that TXT file from UTF8 to Windows1252 or the ANSI you need to use.

gidon500
Creator II
Creator II
Author

hi

I get syntax error when I run this script

what am I doing from

gidon

Miguel_Angel_Baeyens

Which script?