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

Formatting issue when storing into text file

I use Qlikview to gather information from multiple sources, process the data and save it to text files. The files are then fed the other systems. The reason I am using QV like this are this are speed and memory usage. Anyhow my problem is that I have a hard time controlling the formatting in the text files. The text files are created using the 'store into'-script command. I have looked around and tried different format specs to solve my problems but to no avail.

Problem 1:

One of the systems have changed and I now need to send in my data using XML. The issue is that some of the XML-tags have attributes and therefore have both spaces and quotation marks. Spaces and quotation marks results in additional " in the output.

Example:

field value/name:

<Tag1 attribute1="value1" attribute2="value2">

results in the following output:

"<Tag1 attribute1=""value1"" attribute2=""value2"">"

Is there a way to get the field value and names as they are in QV when storing them into a text file from the script? I would prefer not to have to externally alter the text files, which is what I currently(/provisionally) do. Nor do I think that the using a script to call the export function in front end is the way to go (file size limited to a certain number of rows forcing multiple files, all files must have certain tags in the beginning and in the end etc).

Problem 2:

All my text file created by 'store into' starts with a few special characters. These characters are not seen in an average text-editor and has, if I remember correctly, something to do with UTF-8. Is there a way to remove these characters from the output?

Question 3:

Is there a way to use store into text files without getting the field name(s) as a header in the resulting file?

//Nils


Example code:

let fieldname = '<Tag1 attribute1="value1" attribute2="value2">';

output:

load 'test' as '$(fieldname)' autogenerate(1);

store '$(fieldname)' from output into 'test.txt'(txt, codepage is 1252, delimiter is '|');

2 Replies
Not applicable
Author

I have the exact same requirement here. I have a table that consists of perfect XML. I would like to store the contents of this table to a file, and then open the file as XML. Problem is that the store command adds the field name to the beginning of the file and messes up the quoting.

Did anyone find a solution for this?

Peter_Cammaert
Partner - Champion III
Partner - Champion III

Better not hijaak an old discussion (without any responses or activity). Create a new one to get specific replies tailored to your situation.

Best,

Peter