Parse a Filename into Parts

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Parse a Filename into Parts Sun Jun 29, 2025 8:49 am • by daylight54
I have a bunch of files with the name in a format such as:
How to_draw a Tiger - and many more -- Dr Doolittle -- a bunch of other things -- even more.epub

I want to parse out up until the second -- so that I end up with
How to_draw a Tiger - and many more -- Dr Doolittle.epub

The problem is I can't figure out how to pattern match. I cant use custom text like (sorry I kept getting a broken link picture when I tried to load the image but here is the link
https://drive.google.com/file/d/1Quf92pGONioZ4aMevrFAV17UfuQ2WFT9/view?usp=sharing
because the titles have special characters. I assume there is some way to do this with a script but I have no idea how to create such a script and I've searched and can't find something close that I could adapt. Thanks in advance for the help!
daylight54
 
Posts: 1
Joined: Sun Jun 29, 2025 4:05 am

Re: Parse a Filename into Parts Mon Jun 30, 2025 9:10 am • by Mr_Noodle
Note that the characters token does not match spaces. You can probably use "anything" there. Also, it might be better to put the -- outside the custom attribute, like you did for the one after part 2.
Mr_Noodle
Site Admin
 
Posts: 11931
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support