I have created a process that allows me to rename a list of pdf files in a folder and move them to another folder. I have a second process that I created that allows me to extract a Client ID from the PDF that I want to use as the file name. My question is how can I combine these two processes? Where can I put the Read PDF to Text process in the folder rename process to make this work properly.
Hi
hope these steps would help you resolve this
âuse a assign activity and get the output with a variable of type array of string arr_filepath = Directory.GetFiles(âyourfolderpathâ,â*.pdfâ)
ânow use a for each activity and pass the above variable as input where change the type argument as string in the property panel of for each activity
âinside the loop use a Read pdf activity and get the output with a variable of type string named str_input
ânow use a Regex and get the match value as well as you have did so far
âassign that match output to a a string variable named str_output
ânext to this use a move file activity where in the property panel mention the source path as item.ToString and in the destination mention as âyourfolderpath\â+str_output.ToString+â.pdfâ
Kindly try this and let know for any queries or clarification
Cheers @Donna_Roberts
I have something wrong in my Body⌠At Read PDF Text I am getting the error: "Compiler error(s) encountered processing expression âarr_filepathâ. Value of type â1-dimensional array of Stringâ cannot be converted to âStringâ.
This looks fine till first part
We need to check the second part of file path thatâs str_output.ToString
Put that in writeline activity and letâs see whats coming up in the output panel
You have your str_output as the Match from the regular expression, so you would need to use like: str_output.Value instead of str_output.ToString⌠But it would be safer that first you validate if it really have a match using If str_output.Success.
So are you saying I need to create a variable as âstr_output.Valueâ or str_output.Success? Because when I replace str_output.ToString with either one, I get a compiler error that says: