Select specific folder

I need to select a folder that always changes numbers (LOT 1942_12_19), (LOT 1943_12_20).
For this I need to ignore “LOT 1942” as it is always summed and only based on the month and day “12_19”.

Capturar2

1 Like

@Renan_Pereira

You can run a loop through the folder-path so that you get the list of sub-folders in that path.

inside the for loop you can have a if condition and string manipulations to get whatever file name you want.

Note:- Try to use the message box inside your file condition to check if you are getting the proper list of folder names.

Regards,
@hacky

Hi
—hope these steps would help you resolve this
—use a assign activity like this
arr_filepath = Directory.GetFiles(“yourfolderpath”)

Where arr_filepath is a variable of type array of string

—now pass this variable as input to FOR EACH LOOP and change the type argument as string in the property panel
—inside the loop use a IF condition like this
NOT item.ToString.Contains(“1942”)
If true it will go to THEN part where we can access the other file paths except the one having 1942

Cheers @Renan_Pereira

Hi @Renan_Pereira

That’s simple try the below code, it will give the path based on the current month and date

Directory.GetDirectories(<yoursourcepath>,"*_"+Now.ToString("MM")+"_"+Now.ToString("dd"))

Where do I enter this information?

@Renan_Pereira Assign into a string