How to loop through string of names and check if any of the file exists?

Hi all,

I would like to loop through these 9 files names that were extracted from an Excel sheet.
image
In order to do so, how would I join these 3 lines into 1 single line, and from there loop through each filename?

Currently the loop will loop through every character instead of every filename

Thanks

Hi,

Can you share what type do you have the above data? Datatable, Single string, string array etc?

Regards,

Hi there,

I store those 9 names in a variable called str_ExcelTable, its a string
Cheers

Hi,

How about the following?

arrStr = str_ExcelTable.Split({","c,Chr(10),Chr(13)},StringSplitOptions.RemoveEmptyEntries)

Regards,

1 Like

Hello,

I have tried to add it but the an errors pops up, saying Value of ‘1-dimensional array of String’ cannot be converted to ‘String’

Hi @SRoyi

Use the Split syntax to split the files by using “,” and store it in a array variable. Use for each activity to loop through the array variable which is stored the splitted file names. Then you can use one on one file name to do the further development.

Array Variable = StringVariable.Split(“,”)

Hope it helps!!

1 Like

HI,

Can you try to set arrStr as String array type?

image

Regards,

Hi,

The loop was able to loop through 9 times now, which was what I was looking for. Thanks for the help. Now I will try to see how I can use the names to for Path Exists

1 Like

Hi there,

thanks for your suggestion! I will take it into consideration during my development

Cheers

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