Jun-13-2023, 02:41 PM
OK. Thanks very much for your help. So eliminating the "/" in file name yes code runs but makes only one new file. But in ths target pdf we have 4 or 5 office visits - changes in the value of "Visit:". And the split did not occur at the first change in the regex. Just seemed kind of random.
I am missing something here. It is like the code is not iterating through to make X number of new pdfs based upon X changes in the regex.
I am missing something here. It is like the code is not iterating through to make X number of new pdfs based upon X changes in the regex.
(Jun-13-2023, 01:42 PM)deanhystad Wrote: Your problem is that the filename for your new file is invalid. Your regex splitting probably works fine.
'output_Visit: 03/23/2023.pdf' is not a valid filename. You cannot have "/" in a filename. The colon is also a bad choice. On windows, creating a file named "output_Visit: some date.pdf" results in a file named "output_Visit".
You need to process the date, maybe changing "/" to "_", and removing the colon and any spaces.