I have folder and I want check two files exists or not

Hi Folks,

I have a simple scenario, that needs your help.

I have a folder “C:\Users\Test” and there are multiple files. I have to check Test.txt, Error.txt files, if exists, I will go for another step else I have to create these two files. how to do it?

Quick help needed.

Thank You

2 Likes

Hi
we can use PATH EXISTS activity and pass the file path of that file as input and get the output with a variable of type Boolean
Like here we can use two path exists activity one next to another and pass the file path and get the output with a variable named bool1 and bool2
—now use a IF condition like this
bool1 = True
If true it will go to THEN part where we can use another IF condition like
bool2 = True
Or if false it will go to ELSE part where we can use WRITE TEXT FILE activity where pass the filepath of the txt file as input

For the inner IF condition with bool2 = True if true it wi go to THEN part where we can Place the next set of activities or it will go to else part where we can keep the WRITE TEXT FILE activity where pass the filepath of the txt file as input

Cheers @Kiranaarpa

2 Likes