I am new to building BOTs.
I am trying to find the number of files - PDF, with similar number in the name.
STRORDERNUM - is a string which i defulat to 36 for my testing however this variable flows from different flows
My Variable
FILENUM = Directory.GetFiles(“--------DATA\06. PNT - Plant\01 Planning\14. Work Order Generator\Work Orders"+”_“+strOrderNum+”.pdf").length
so if strordernum = 20
file names like
A_20_SAB.pdf
B_20_XYZ.pdf
FILENUM = 2
However everytime i run i get illegal character message
Thank you KannanSuresh,
have managed to find number of files by C#, appreciate your prompt reply.
Can you please suggest - I am trying to merge PDFs, where
A_2_Z.pdf
B_2_X.pdf
2 = strordernum, for this i have used below which i think gives me an error, can you suggest
Filelist - {“M:-----------\14. Work Order Generator\Work Orders",”“+strOrderNum+”.pdf",“M:\M487----------------t\01 Planning\14. Work Order Generator\Work Orders",”“+strOrderNum+”.pdf"}
System.IO.Directory.GetFiles will give you a string array of the files that match the criteria. Find file names using that instead of concatenating string.
Thanks for your help, one hurdle cross. however my situation is to get files from two different folder where they contain the same name which STRORDER. SO the name in two folders is always
Folder 1
A_STRORDER_123
Folder 2
B_STRORDER_134
Bot should merge them and store at a different location the name would be
B_STRORDER_134
For this i am trying to get all files from directory merge options and using below
I am first trying to get directories however it is a failed attempt
system.io.Directory.GetDirectories(“M:\XYZ\DATA\06. PNT - Plant\01 Planning\14. Work Order Generator\Work Orders\AllCombinedAttachments",“M:\XYZ\DATA\06. PNT - Plant\01 Planning\14. Work Order Generator\XYZ 3.5.21"”“+STREOrderNum+”.pdf”,SearchOption.AllDirectories)
This is accepted, however running this shows illegal characters?
Would you have any idea how to acheive merging PDF with almost similar names from two different folders?
Thank you prasath, this happens to get me the files from different location. I accept this as a solution. As I am learning more of such strings, is there a document or a library you can direct me to if i am stuck on such equations and want to learn further. - thanks
I do lot of search in the forum in the beginning when I started learning UiPath, And when I see a new/good formula I will bookmark that solution and also copy the formula to my personal sheet and immediately I create a practice exercise to execute this. This helped me a lot.