View Single Post
Old 04-17-2022, 03:15 PM   #6
rtiangha
Evangelist
rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.rtiangha ought to be getting tired of karma fortunes by now.
 
Posts: 495
Karma: 356531
Join Date: Jul 2016
Location: 'burta, Canada
Device: Kobo Glo HD
Hmm, well, if you're just using Caibre's Save to Disk function and then manually copy the book over rather than using the Kobo driver to transfer the file, it looks like Calibre already scrubs all the characters in @davidfor's regexp from the filename except for these: %;$!'

The characters I've encountered the most issues with are books with ! and ' in the titles, so under the Save Template in the Saving Books to Disk options, I had this:

Code:
{author_sort:re('|!,)}/{title:re('|!,)} - {authors:re('|!,)}
but thanks to @davidfor's hint, this will take care of all the ones Calibre doesn't already strip away:

Code:
{author_sort:re('|!,)}/{title:re([\'!%;\$],)} - {authors:re([\'!%;\$],)}
although I don't know why putting the same expression into author_sort makes Calibre complain.

Anyway, you can copy/paste that (to capture the correct ' character) and you should be good to go as long as you Save to Disk first before copying files over to the device.

Last edited by rtiangha; 04-17-2022 at 04:27 PM.
rtiangha is offline   Reply With Quote