Need Help with Grabbing File Name & Extension


#1

Hi All,

I’m new to UiPath, and do not have any coding experience. Just finished all the video tutorials on the site and a basic VBA course on Youtube to get a sense of what I am doing.

I have a very specific procedure I want to build a RPA around for my small business: To have UiPath check the cloud folder every 5 mins, and if there is a new project file, open the corresponding software (translation or tax) to work on the project. Then save the finished file to another folder.

Most of these procedures can be designed in UiPath fairly easily after some basic training, however I struggle to do the following:

  1. Check a path to see if any new files exists. (all the old files will be removed after processing, so basically checking all files in a certain path). I did find some help on the forum on getting the file name using (Directory.GetFiles(folderPath)). However, I am not sure how to embed this code into the UiPath Design. Do I need to use NuGet? It seems a bit too overwhelming for someone with little background in RPA or programming.

  2. How to extract the file extension info. Since the project files will be in different format (pdf, word, image) I will design to the RPA so that it will convert the file into a standardized format first before processing.

Also, I think I can build this RPA with AutoIt. which seems a little easier to use and have lots of well-written codes on the internet just a Google away. Will UiPath be an overkill for my goal, and should I switch to AutoIt?

Appreciate all the help and suggestions!


#2

Hi,

You can use System.IO.File.Exists(“C:\XXXX.XXX”) in an IF activity to check whether the file exists.

To get the extension you can use:
new System.IO.FileInfo(“C:\XXXX.XXX”).Extension

No need to add any external libraries for the above…

As for the technology, it does not really matter as this can be automated virtually in any RPA tool. It’s up to you to choose the one that you are the most comfortable with.


#3

Thank you so much!! super helpful!