I have the folder with a lot of .zip files. There are many folders in the zipped file. I want to move the .pdf file in the folder named attachments to a different folder. Can you help me?
Welcome to forum
The first thing u need to do is u need to unzip the folder and then take the pdf files and move to another folder
Can you help me with what activities I should use?
Steps to be followed
First unzip the folder using zip activvity. U can use balareva activities for this
Second after extracting the folder, u can use the move files activity to move your files
Can u send a screenshot of how your file structure look like?
@ridvanucok - So first you have to unzip/extract all the folders in the zip file first…
Then read all the folder using directory.getfiles…and then in the folder…move the file one by one to the new zip file.
please confirm if my understanding is correct? if yes, I can build a sample workflow for you.
so each one is a compressed folder? @ridvanucok
Yes. Each zipped file.
There are many zip files in a folder. Each zip file has a folder called attachments. In the folder named attachments there is pdf with filename variable. I want to move these pdf files in each zip file to a different folder.
@ridvanucok - Got it…Almost…will share the workflow in a min
Update: Unzip_Pdf_Rezip.zip (371.7 KB) … Run this workflow as is you will see new ZippedPDFFiles.zip created in the project folder…
- First extract all the zip files to a folder
2.Extract only .pdf files and move to new PDFFiles folder
- Zip the PDFFiles folder(If you dont need this step just simply delete/ignore)
Hope this helps…
What activity did you use in this area?
@ridvanucok - That is Extract/Unzip Files activity…
Other one is…
What package is this installed? These activities are not loaded in my program.
@ridvanucok …what version you are using ? Also go to manage packages and check any of your packages needs to be updated(shows with blue arrow).
Thank you so much for your help. df file names in the attachments folder are the same and overwrite. Do you have a suggestion for this?
@ridvanucok …oh…so in your case each attachments folders has pdf files with same name? Say
1.Zip > attachment > 1.pdf
2.zip > attachment > 1.pdf
3.zip > attachments > 1.pdf
@ridvanucok …hmm…in that case you have to put the each attachment folder pdfs in individual folder with zip file name. Say
1 > 1.pdf
2 > 1.pdf
3 > 1.pdf
Can we change the names of the .pdf files in the folder and move them to a new folder after doing as you mentioned?
@ridvanucok - how you are thinking of renaming the files? May be we need to add the zip folder name to the files…like
zipfile1 > attachment > 1.pdf to zipfile1_1.pdf
this will make pdf file name unique…