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

One Star

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.
One Star

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

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?
One Star

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

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?
One Star

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

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?
One Star

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

Yes, you're right
One Star

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

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...
One Star

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

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?
One Star

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

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