Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Saving pdfs from zip files

MayPaul
5 - Atom

One zip file contains pdf, xls and csv files. Among those files, i am trying to save pdfs to destinated folder. The problem is getting "FileNotFoundError" when i give pdf file path eg . C:\\Users\\XXX\\OneDriveXXX\\root\\Documents\\xxxxx.zip\\xxxxx.pdf

 

How should I give full path of pdf file under zip file? please help.

2 REPLIES 2
Rhys_Cooper
8 - Asteroid

Hi @MayPaul. I replicated your issue and designer and it appears that the text input tool when provided with a fiilepath to a zip file does not have the ability to unzip the file. This is probably because windows asks for the location the user wants to unzip the file into.

 

Proposed solution: unzip the file manually and replace the file path with this location.

 

Let me know how you get on with this and we can look into this further

 

Regards - Rhys_Cooper

BS_THE_ANALYST
14 - Magnetar

@MayPaul I'd use Python for this.

 

I'll attach a workflow where you'll be required to enter two things. The location to your zip file and also the location where you want the file to be unzipped. i.e. 

1.png

Everything will work automatically from thereforward. I'll briefly explain how you can alter the python script:
2.png

There's a red arrow in the script above. This is the part that walks through your zip file and only extracts the .pdfs. If you ever want to remove that functionality, just delete everything in the extractall function except path=unzip_location.

Any questions, just shout. All the packages come shipped default with Python so there shouldn't be any issues with library imports.

 

All the best,

BS

Labels