Open folder path

I have a process where I have to download files, after the files are downloaded i have to open them and manipulate them.

I have my robot opening this folder with a click activity, how would could i open this folder with the file path instead of a click activity. I have to pass this process on and it would be more efficient to open the folder using the path instead of a click activity.

@NATHAN_MORA Why do you want to open the Folder? Can you describe your process?

Hi @NATHAN_MORA,

If you have files in folder and you wants to manipulate then simply you can iterate through the path
by using for loop "Directory.GetFiles(“Your Path”)"
image
then once you get the file path then you can manipulate

I have to download excel files from a web page, once those files are downloaded i need to open the folder they are downloaded to and unzip the files. As of right now I’m unzipping the files one by one with a right click activity for each file. After the files have been downloaded I’m using a click activity to open the folder where the files are downloaded and then executing the right click activities to unzip the files. I have to pass this robot on to a working project so a click activity to open the folder where my downloaded files are would not work once i pass it on since there machine will be different. If I had a way to open the folder(folder path) with the downloaded files it would be easy to just tell the end user to paste there folder path in the already built activity. I have attached a picture of where i would like to change the click activity to open a folder to a open the folder using the folder path.Click Activity

click 2|458x500

Thanks For the Help!!

1 Like

@NATHAN_MORA So the Operation is to just Unzip the Files present in a Folder ?

1.Open folder with the 3 downloaded files
2.Unzip the 3 files
3.Aggregate 3 files into one file
4. remove columns J:K
5.Replace columns J:K with L:M

I have 3,4,5 done, I have a right click activity going through each file and unzipping them one by one, which I don’t think is very efficient. I just got the zip and unzip packages and i’m able to unzip one file at a time.

I would like to open the folder where the downloaded zip files are and unzip all three of them instead of one by one. I think a for each and the unzip activity can work to unzip all three files instead of using right click activities for each file. that way the robot will open the folder and just unzip whichever files are downloaded into that folder.

Does that make it easier to understand?

@NATHAN_MORA Can you install the ZipFile Package and check whether you are able to Unzip one file. If you are able to do so, You can then use Directory.GetFiles(yourFolderPath) to get the List of files in the Folder, Loop them one by one using For Each Loop, and unzip them One by one.

I have the packages and I can unzip one of the files. just working on the process you mentioned . Just not sure how to put it all together. Trying to figure out how to add the unzip activity in the for each loop.

unzip

Does this look close?

@NATHAN_MORA Can you follow these steps :

  1. Read the List of Files using Directory.GetFiles(yourFolderPath,"*.zip") to get all zip file Paths present in a Folder, in this way :
    fileList (Array (String) ) = Directory.GetFiles(yourFolderPath,"*.zip")

  2. Use a For Each Loop, Change the Type Argument to String.
    Inside the For Each Loop, use UnZip File Activity
    Pass the item variable of For Loop as the ZipFile Path value of UnZip File Activity.
    Pass the Directory where you want to Store the UnZipped Files to UnZip Folder Path

  3. After Execution, All the Files should be present in the Specified Folder.

@NATHAN_MORA Yes, Did it Work ? :sweat_smile:

No but i think Im close. i used a assign activity, in the right column i made a variable called zipped files and in the left i put the path and the Directory.GetDirectories(“C:\Users\I29075\Desktop\Liberty Downloads,”".*zip") for my path.

then i put a for each activity with the zipped files variable i made in the assign activity in the left column.

Its not working, am i close?

The expression editor in the picture is from the assign activity right column

@NATHAN_MORA My Apologies :sweat_smile: , The Comma Should be after the FilePath in this way in the Assign Statement :

Directory.GetFiles(“C:\Users\I29075\Desktop\Liberty Downloads”,"*.zip")

Try this and Check

Im still getting errors, I have attached everything i have for this process and the files paths. Let me know what you think and lets get this thing knocked out. First is the assign activity then the for each then the unzip. The bottom picture is the for each and the path i put in the expression editor. The top picture is what i added into the expression editor and the zipped files variable i created. Let me know what you think.

@NATHAN_MORA Why do you use GetDirectories ? It Should be GetFiles

I got it working lol, Thanks for the help!!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.