Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-18-2010, 02:21 AM   #1
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
regex for character replacement, em-dash questions

I'm hoping to learn how to fix up various small annoyances in conversions via regex & have some related questions.

1. em-dash, en-dash - to mess with these, how do I type the characters into the regex i.e. is there a way to generate an emdash or endash with the keyboard ?

2. find + replace syntax: I see lots of helpful examples for removing stuff with regex but what is the generic construction of a find / replace all command

3. as a specific, I could fix up one book if I could replace all "?" with em dash, EXCEPT for those ? which are followed by a close speech quote. this would take 3 passes in word: 1. change all ?" to , say, QMQM". 2 change all "?" to em dash. 3 change all QMQM back to ?"

PS following a link to here https://wiki.mobileread.com/wiki/Special_characters
I read that em-dash, en-dash are NOT supported on Kindle, but it does not say what would be displayed if one was included in a .mobi file - I assume that the .mobi spec does support them ?

Last edited by cybmole; 10-18-2010 at 02:29 AM.
cybmole is offline   Reply With Quote
Old 10-18-2010, 04:20 AM   #2
Manichean
Wizard
Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.Manichean is the 'tall, dark, handsome stranger' all the fortune-tellers are referring to.
 
Manichean's Avatar
 
Posts: 3,130
Karma: 91256
Join Date: Feb 2008
Location: Germany
Device: Cybook Gen3
I don't think Calibre can do search & replace on book contents at all. As for regex construction, those follow the same rules in other programs as they do in Calibre (though caveats may apply, e.g. Notepad++ doesn't allow regex matching across linebreaks). Go read a tutorial, if you need to learn regexes.
Manichean is offline   Reply With Quote
Advert
Old 10-18-2010, 05:00 AM   #3
cybmole
Wizard
cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.cybmole ought to be getting tired of karma fortunes by now.
 
Posts: 3,720
Karma: 1759970
Join Date: Sep 2010
Device: none
Quote:
Originally Posted by Manichean View Post
I don't think Calibre can do search & replace on book contents at all.
OK - I'll stick with converting & editing via notepad++ ,word etc.

just wanted to be sure I was not missing any simpler route.

I thought there might be an option to use a character conversion table so that,say, all instances of en-dash ( not supported on Kindle) can be replaced with a character that is supported. Maybe that already happens ?
cybmole is offline   Reply With Quote
Old 10-18-2010, 03:09 PM   #4
jackie_w
Grand Sorcerer
jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.jackie_w ought to be getting tired of karma fortunes by now.
 
Posts: 6,248
Karma: 16539642
Join Date: Sep 2009
Location: UK
Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3
If you can see m-dash/n-dash, curly quotes etc in your source file and you want ordinary dashes and quotes in the converted file, then a simple check of the box 'Transliterate unicode chars to ASCII' on the Convert - Look&Feel page should be enough.

However, if the source has already 'lost' the special chars to ?'s then I'm afraid you're stuck with using an editor and guesswork on your source.
jackie_w is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
FB2's and Em-dash Soxendom Workshop 1 10-13-2010 02:27 PM
RegEx REPLACEMENT: Help needed! LARdT Sigil 12 01-04-2010 07:25 PM
[2.0] "em dash" character not displayed superanima Bookeen 4 12-27-2009 07:06 AM
Getting a warranty replacement, have questions Dragoro Amazon Kindle 1 10-20-2009 01:02 AM
Creator The em dash Argel Kindle Formats 8 07-12-2008 08:45 AM


All times are GMT -4. The time now is 03:23 AM.


MobileRead.com is a privately owned, operated and funded community.