I have created a bot that will read the files in a PDF then split all the files into individual PDF files. That works well, it names the file with a number at the end of the name file. It creates 365 files. The ask is if this can create separate files with the doctors name that appear in the PDF. For example Abdelaal, Ihab DO.pdf not the file name PDF Export with bookmarks 2021-12-07 VBI(1).pdf and so on.
I used read PDF text and output the first files data. (image 1)
Hey,
You have few option but it’s depends from content of PDF file.
But based on the output which you showed us I think that you can split text by new line. Of course if the name of the doctors appear always in the first row
So, for example:
array = extractPDFVariable.Split({vbLf},StringSplitOptions.RemoveEmptyEntries)
str it is your extracted text from pdf.
Array is the splitted extracted text by new line. It means every new line is the new array element.
If you will take first item of the array you will get name of the doctor.
Of course you can delete extra characters like comma (,) etc. to use this name for file name but it will be only string manipulation.
Because ‘files/’ is folder inside my project specially to show you example. So, probably you don’t have this folder in your project.
You can create or change the path.
But I also noticed that it downloaded some additional data for the name.
To do this right way, you should share pdf content as a .txt file.