Finding a file based on a partial pathway

Please see photo attached:

I have these pathways here, and can only provide the first P number, how can I find the whole pathway for example if I only have P1311271 in the robot?

I also need to find all if there are day 5 files for this number

Thanks

Hi @aquinn

Use wild card(*) after the P number in the file path.

And how would I manage to find all of the pathways if there are say 5 files with the P number

@aquinn,

Check with this,

DirectoryInfo("YourDir").GetFiles().Select(Function(file) file.Name.Contains("SearchString")).ToArray()

Thank you, and then just use a for each row to determine what I do with each file?

@aquinn

Use directiry.getfiles(“folder_path”,“P number*.pdf”)

This will get all the similar name files into an array then use for each for further process.

Hope it helps.

@aquinn,

You will get list of files for each search if it matches with number in the filename

How do i use this in an assign or what activity do i use it with

@aquinn

You need to give P1311271 in P number like this

Use Directiry.GetFiles(“folder_path”,“P1311271*.pdf”)

How do i set this so P number is a variable opposed to fixed text

@aquinn

Store the fixed part in a variable and pass like this:
str_path = “P1311271”
Use Directiry.GetFiles(“folder_path”,"str_path.tostring+*.pdf”)

@aquinn

My bad
Use Directiry.GetFiles(“folder_path”,str_path.tostring+"*.pdf”)

Thank you, then do I just need to use a for each to iterate through the files? and store this in a string array?

@aquinn

Based on the next process.
What’s the next process. what do you want to do with these files?

I just need to print out all of the complete pathways

@aquinn

Then use for each loop and print the paths beacuse these paths are all stored in a array.

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