Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How to extract a zip file that contains several other zips files

avatar
New Contributor

Hi

I've zip file that contains several other zips files.

I want to extract the main ZIP and all other zips files (Recursive)

Can anyone please advise how to do this using NIFI ?

1 ACCEPTED SOLUTION

avatar
Super Guru

@Nifi_Al ,

 

Here's a way to do that:

 

araujo_0-1648116148018.png

 

The RouteOnAttribute processor checks the file name and if it's a ZIP file it sends it for unpacking. Otherwise sends the non-zip file downstream.

 

araujo_1-1648116231378.png

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

View solution in original post

2 REPLIES 2

avatar

@Nifi_Al  Use getFile/putFile to read and write in your flow.  Then If you use unpackContent against a zipped flowfile it should create individual artifacts flowfiles which can be additionally unzipped further.   Alternatively, if you can create a script to unzip recursively, you can use nifi to executeScript. Maybe even use executeProcess too.

avatar
Super Guru

@Nifi_Al ,

 

Here's a way to do that:

 

araujo_0-1648116148018.png

 

The RouteOnAttribute processor checks the file name and if it's a ZIP file it sends it for unpacking. Otherwise sends the non-zip file downstream.

 

araujo_1-1648116231378.png

Cheers,

André

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.

 

--
Was your question answered? Please take some time to click on "Accept as Solution" below this post.
If you find a reply useful, say thanks by clicking on the thumbs up button.