Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Restore Archive 1

Status
Not open for further replies.

questtx

Programmer
Apr 20, 2005
3
US
I can archive files. Now I need to restore archived data. I can't get it right. can't be that hard.

I zippped file.txt to file.txt.zip.

I wrote this a bunch of ways but thought one of these should work.

put("zip", "file.txt.zip,file.txt")

put("restore", "file.txt.zip,file.txt")

I think this should be easy but my mind is stuck in a loop.

 
Two questions: 1. What version are you using.
2. Have you read the documentation.

The following is the syntax of the Archive (Zip) adapter commands used for data sources:
archive_name,files_to_unzip

Don't use PUT or GET, use a card target.

BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
671

I looked at the docs. Pretty poor. Its ok for zipping but unzipping leaves to be desired.

For unzipping all it said is what you said minus the 'card target' comment.

are you saying I need to use two maps with a run command?

run("unzipmap","-if1 "file.txt.zip,file.txt, -of1 file.txt")
 
Opened case with Documentation & Engineering on the unzip.
Shouldn't need run map, just use the command in an input card (one text blob element), and map the result to a file.
If this doesn't work, create simple test case and send to Ascential Support.

BocaBurger
<===========================||////////////////|0
The pen is mightier than the sword, but the sword hurts more!
 
You can unzip your file with one map if you have a static input file name. Set the input card source to 'Archive Zip' on the command line enter 'file.txt.zip,file.txt'. Set the output card source to 'File' with a file name of 'file.txt'.

You can either execute your map with via the Command Server via a script or another map overriding your input/output cards as needed. From within a map your rule would look something like this:

=run ("mapname", " -iazip1 file.txt.zip,file.txt" + " -of1 file.txt")

or

=run ("mapname", " -iazip1 '" + getresourcename(Input1),substitute(getresourcename(Input1), ".zip", "")+ "'" + " -of1 "+substitute(getresourcename(Input1), ".zip", "")+ "'" )

I tested the first option and it works you may need to play around to get the second to work. If it fails verify the punctuation or try putting the 'substitutes' in an earlier rule cell.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top