Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Coming Aug. 9: New Simplified Authoring for Qlik Sense SaaS – For Details, CLICK HERE
cancel
Showing results for 
Search instead for 
Did you mean: 
qlikviewforum
Creator II
Creator II

Avoiding double quotes when storing table in a text file!

Hi All

store Table into Data.bat(txt);

When I am trying to load the data into a txt file double quotes is getting added along with that.

For example:

If the original contains something like below.

"\\thrtjh568\qv\server\qvw\Development\QVD\Expense"

When it stores it into a txt file. It stores something like below.

""\\thrtjh568\qv\server\qvw\Development\QVD\Expense""

How can I eliminated double quotes when storing it in a text file. Please help!

Regards,

qvforum

14 Replies
EmmaC
Partner - Creator
Partner - Creator

Hi! did you find a solution? I have the same problem!!

regards, Emma

stevedark
MVP
MVP

Hi Emma,

I have settled for writing out slightly malformed HTML, by not using double quotes in the text.

As far as I am aware there is not a solution.  Pushing this thread back into view may turn something up though.

Steve

EmmaC
Partner - Creator
Partner - Creator

Hi Steve,

I had to settle with

(Get-Content Menu_List.html) | ForEach-Object { $_-replace '""', '"' } | Set-Content Menu_List.html


This cannot be the solution, though.


regards, Emma

Frank_Hartmann
Master II
Master II

Jonathan_Green
Contributor
Contributor

Writing HTML to file can cause one to run into three avoidable problems:

1. FIELD TRUNCATION:
Generating the HTML using LOAD INLINE will truncate your lines of code on commas which are being treated as field-delimiters.
We only want a single field, so avoid LOAD *, and most importantly, specify a non-printing-character delimiter:

LET vInlineDelim=CHR(07); // something that will not occur in text eg BEL

EMailOutput:
LOAD <!DOCTYPE html>
INLINE [
<!DOCTYPE html>
<html>
…… lines of html ….
</html>
] (DELIMITER IS ‘$(vInlineDelim)’);

2. DOUBLE QUOTES IN THE OUTPUT FILE
The next issue is caused by the STORE command, which ‘escapes’ quote marks by double-quoting as it attempts to create a CSV.
So, remove ALL single & double quotes from your HTML. However, for the HTML-tags still to work, you must also remove ALL SPACES from within tags:
<span style=font-family:Helvetica;font-weight:normal;Font-size:10pt;color:red> will give you Helvetica, red, 10pt.
<span style=font-family:Helvetica;font-weight:normal;Font-size:10pt;color: red> will give you Helvetica, 10pt but not in red, because of the leading space before “red”.

3. COMMAS CAUSING QUOTES AT START AND END OF RECORD
Any commas in the table’s field will by default cause STORE to enclose the field in double-quotes. To avoid this, include here also a DELIMITER IS:
STORE EMailOutput INTO [{filepath}EmailOutput.html] (txt, DELIMITER IS ‘$(vInlineDelim)’);