aquinn
(Aquinn)
July 12, 2023, 8:50am
1
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
supriya117
(Supriya Allada)
July 12, 2023, 8:54am
2
Hi @aquinn
Use wild card(*) after the P number in the file path.
aquinn
(Aquinn)
July 12, 2023, 8:55am
3
And how would I manage to find all of the pathways if there are say 5 files with the P number
sarathi125
(Parthasarathi)
July 12, 2023, 8:57am
4
@aquinn ,
Check with this,
DirectoryInfo("YourDir").GetFiles().Select(Function(file) file.Name.Contains("SearchString")).ToArray()
aquinn
(Aquinn)
July 12, 2023, 8:58am
5
Thank you, and then just use a for each row to determine what I do with each file?
supriya117
(Supriya Allada)
July 12, 2023, 9:04am
6
@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.
sarathi125
(Parthasarathi)
July 12, 2023, 9:08am
7
@aquinn ,
You will get list of files for each search if it matches with number in the filename
aquinn
(Aquinn)
July 12, 2023, 10:35am
8
How do i use this in an assign or what activity do i use it with
supriya117
(Supriya Allada)
July 12, 2023, 10:39am
10
@aquinn
You need to give P1311271 in P number like this
Use Directiry.GetFiles(“folder_path”,“P1311271*.pdf”)
aquinn
(Aquinn)
July 12, 2023, 10:41am
12
How do i set this so P number is a variable opposed to fixed text
supriya117
(Supriya Allada)
July 12, 2023, 10:44am
14
@aquinn
Store the fixed part in a variable and pass like this:
str_path = “P1311271”
Use Directiry.GetFiles(“folder_path”,"str_path.tostring+*.pdf”)
supriya117
(Supriya Allada)
July 12, 2023, 10:46am
16
@aquinn
My bad
Use Directiry.GetFiles(“folder_path”,str_path.tostring+"*.pdf”)
aquinn
(Aquinn)
July 12, 2023, 10:46am
17
Thank you, then do I just need to use a for each to iterate through the files? and store this in a string array?
supriya117
(Supriya Allada)
July 12, 2023, 10:48am
18
@aquinn
Based on the next process.
What’s the next process. what do you want to do with these files?
aquinn
(Aquinn)
July 12, 2023, 10:48am
19
I just need to print out all of the complete pathways
supriya117
(Supriya Allada)
July 12, 2023, 10:53am
20
@aquinn
Then use for each loop and print the paths beacuse these paths are all stored in a array.
system
(system)
Closed
July 15, 2023, 10:53am
21
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.