Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to Extract a long string (LZH compressed) as save it as a file

Hello!
I would like to extract long data from a SQL source database:
- one column contains the file name
- a second one (string with length 2147483647) shoud be the contain of original file attached then compressed with LZH.
First, is there any component which allows to create a file based of a column value? If yes, which one?
Secondy, how can we uncompress the string before saving the file?
Any suggestions, please?
Thanks.
Labels (2)
7 Replies
Anonymous
Not applicable
Author

what do you mean by component which allow to create a file based on a column value?
like this
myfile=
a
b
c
d
e
"Secondy, how can we uncompress the string before saving the file?" do you want to uncompressed the file?
Anonymous
Not applicable
Author

IN system, the attachments are not stored in a vault (with a reference in a table) but stored as a hudge string. This string is the result of the compression with method LZH of the contains of original filer.
Example of Table:
Key FileName Data
id1 doc1.doc AREATET76416161561541ZTYZRTYZRYTZR....
id2 doc2.doc AREATET65765761561541ZTYZRTYZRYTZR....
So, i would like to rebuild each file by making the reverse job: for each record, uncompress the string Data and save the result in a file FileName.
Is it better?
Anonymous
Not applicable
Author

I'm not sure but I think I've understand your problem.
You want to create some file doc1.doc, doc2.doc wich are the result of the uncompression of data.row1, data.row2 etc...
so You want to create temp files with the value of data.row1, data.row2
Am I right?
Anonymous
Not applicable
Author

Yes, you're right
Anonymous
Not applicable
Author

I can't test it here. But have you tried to write your data with a tFileOutputXXX? I would say this is the only solution for your problem. But you may run into problems with encoding...
Anonymous
Not applicable
Author

You question isn't really easy, don't worry I'm working on it. Please wait a moment.
What software do you use to unzip LZH?
Anonymous
Not applicable
Author

for LZH uncompression, I am looking for a Java code (in ordr to use it in TOS) which uncompress LZH string. not found yet.