cancel
Showing results for 
Search instead for 
Did you mean: 

unzip and pick one file from multiple files

VaishaliNTTData
Explorer
0 Kudos

Hi All,

I need an urgent help in below scenario: in the source directory2 files are zipped and placed. According to the requirement I have to unzip and pick only one file among the two.The sender adapter is SFTP, so it cannot pick the zipped folder and unzip it in java mapping. And If I use payloadzipbean module it is unzipping and picking both files. How can I unzip and pick only one of the file? By the way one of teh files is .xml and another is .xsd The file not required is .xsd.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Vaishali,

Try below..,

Use payload zip bean in sender CC and write unzipped files on application server using receiver File CC. Do configure another scenario to pick up the file .xml using sender CC which you reuqired and continue with your mappings and other stuff.

While writing the files of .xml and .xsd you can put a condition in Receiver Determination and write only .xml file and leave .xsd file with option no receiver found and no furhter processing.

This is one of the option you can try if you are not able to go with OS command. However you first check with your source system end and understands why they are zipping both the files.

Cheers

Veera

VaishaliNTTData
Explorer
0 Kudos

Hi Veera and All,

Is there any way to do this using java mapping. Another thing to add is that the xml file is expected to be huge in size around 80mb

gagandeep_batra
Active Contributor
0 Kudos

Hi Vaishali

you can run winzip OS command before picking the file of server.

requirement for run these command is you should include winzip file on server path directory

command should like that   :

winzip32 -min -a xx.zip. fil1.doc

plz see following for more zip command

http://www.rondebruin.nl/parameters.htm

Regards,

Gagandeep

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

How can I unzip and pick only one of the file? By the way one of teh files is .xml and another is .xsd The file not required is .xsd.

You can try to run an OS Script to Unzip the file first and then pick the ones you need. But it is always best to handle this at the sender side e.g ask them not to zip the .xsd and then you don't need to change anything in your end.

Hope this helps,

Mark