Python Forum
Splitt PDF at regex value
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Splitt PDF at regex value
#3
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.

(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.
Reply


Messages In This Thread
Splitt PDF at regex value - by standenman - Jun-13-2023, 12:39 PM
RE: Splitt PDF at regex value - by deanhystad - Jun-13-2023, 01:42 PM
RE: Splitt PDF at regex value - by standenman - Jun-13-2023, 02:41 PM
RE: Splitt PDF at regex value - by deanhystad - Jun-13-2023, 04:58 PM
RE: Splitt PDF at regex value - by standenman - Jun-13-2023, 06:00 PM
RE: Splitt PDF at regex value - by deanhystad - Jun-13-2023, 06:14 PM
RE: Splitt PDF at regex value - by standenman - Jun-13-2023, 07:03 PM
RE: Splitt PDF at regex value - by deanhystad - Jun-13-2023, 07:14 PM
RE: Splitt PDF at regex value - by standenman - Jun-13-2023, 07:16 PM
RE: Splitt PDF at regex value - by standenman - Jun-13-2023, 09:37 PM
RE: Splitt PDF at regex value - by deanhystad - Jun-14-2023, 12:18 PM
RE: Splitt PDF at regex value - by Pedroski55 - Jul-11-2023, 01:25 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020