Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
I am trying to store a text file using the qlikview script as beneath :
STORE Storetable INTO [Path\$(vName).txt]
(ansi ,txt, codepage is 1252, embeddedlabels, delimiter is '|', no quotes)
;
This text file will then be sucked up into another long standing script which reads many text files with Western European as the character set. However the above store will only store them as UTF-8 format. Its not feasible to change the long standing to read character sets as UTF-8. The store needs to force the file to be Western European (if you look at qlikview Help file the format specifications are limited to ansi as closest match).(NB I dont know much about these character sets so please forgive my lack of knowledge with them)
I have produced many text files using a macro and vb script as such
Sub ExportTable()
set Converttotxt = ActiveDocument.GetSheetObject ("TB01")
Converttotxt.Export "Path\Filename.txt","|"
End SUB
I want to move away from using the vbscript if I can do everything in the script itself.
Any help would be really useful.
Many thanks
Adam
Hi Adam,
I am a little confused myself, as to my knowledge, the above should export the data as ANSI Western European code page (1252). Are you saying that doesn't work?
Regards,
Stefan
Hello Stefan,
Thank you for the response.
If I then go to load the file produced from the store above into Qlikview, it only recongises it as UTF-8 in the drop down box Character Set within the Table file wizard. If I then select Western European as the character set it inserts ' ' before the first field name into the script.
Many thanks
Adam
Hi Adam,
I just found http://community.qlik.com/message/130480#130480
and indeed the help file states about STORE command that it will only export in UTF-8.
A QVD or a CSV file can be created by a store statement in the script. The statement will create an explicitly named QVD or CSV file. The statement can only export fields from one logical table. The text values are exported to the CSV file in UTF-8 format.
Since you already use macros to write your files, I have no other ideas, sorry.
Maybe you could use some external conversion from utf8 to latin1, like http://www.perlmonks.org/?node_id=600291
Probably not the right program, but you could execute some external from your script right after storing.
Regards,
Stefan
edit:
This looks quite promising if you are going the external program way:
http://superuser.com/questions/69091/batch-change-encoding-ascii-files-from-utf-8-to-iso-8859-1