07-04-2012, 03:59 AM | #106 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
An ePub is a zip, so just extract the file you want to modify, change it with vim (or your preferred editor), and zip it back.
|
07-04-2012, 08:02 PM | #107 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jul 2012
Device: Kindle Fire
|
Doh! I should have thunk of that! Thanks!! By the way I got to the end of my first tutorial with Vim. I can now say I performed my first "yank and put". Pretty neat editor. I have tried to make the ¬ character in Vim but it doesn't work as it does in this message. (alt-170). Can you tell me how to make it in Vim?
update: well it works as you said, sweet! I just copied the "¬" but I still would like to learn how to make it in Vim. Thanks. Last edited by mrjoeyman; 07-05-2012 at 01:33 AM. Reason: ¬ |
Advert | |
|
07-05-2012, 04:26 AM | #108 |
frumious Bandersnatch
Posts: 7,536
Karma: 19000001
Join Date: Jan 2008
Location: Spaniard in Sweden
Device: Cybook Orizon, Kobo Aura
|
I use ¬ because I can easily input it with my keyboard layout (Spanish): AltGr+6. Use whatever symbol you can find in your keyboard that's not used elsewhere: #, ~, @...
|
07-07-2012, 12:05 AM | #109 | |
Zealot
Posts: 119
Karma: 64428
Join Date: Aug 2011
Device: none
|
Quote:
<ctrl-v>uac<esc> In human language, this means: hold down the "ctrl" key and press v, release both, type uac, then tap the "esc" key. The "ctrl-v" says a multi-keystroke character follows, "u" means it is UTF, "ac" is the hex code for the "not" symbol, and "escape" ends the sequence. Having said all that, it is a lot easier to just use some other seldom-used character that appears on your keyboard, such as "@", instead of the "not" character. |
|
07-07-2012, 09:49 AM | #110 |
Junior Member
Posts: 7
Karma: 10
Join Date: Jul 2012
Device: Kindle Fire
|
Thanks, you are right, simple is better
|
Advert | |
|
08-06-2012, 10:22 AM | #111 |
Evangelist
Posts: 490
Karma: 1665031
Join Date: Nov 2010
Location: Vancouver Island, Nanaimo
Device: K2 (retired), Kobo Touch (passed to the wife), KGlo, Galaxy TabPro
|
First thanks for everyones help here. While I haven't posted for help the answers to other peoples problems has helped me as well when I had similar questions. however I have a question that I don't see an answer to.
I am trying to remove a start and end div tag. These span an entire chapter. Code:
<body> <div class="story" id="part-27"> ... </div> </body> FIND Code:
<div class="story" id="part-\d+">(.*?)</div> Code:
<div class="story" id="part-\d+">(.*)</div> EDIT: Ok it seems that the regex was fine, it just doesn't work in 0.5.902 but does work in 0.5.3 which I don't like using much for finding/replacing because over half the time I get left with a literal \1 instead of the actual text. Which of course I have to UNDO, FIND, REPLACE for each. Easy enough when it's a large block of text, not so easy when it's a word or sentence forcing me to do another FIND for any 1< instances. A REPLACE ALL is just a nightmare if you don't have a backup. Last edited by Danger; 08-06-2012 at 10:40 AM. |
08-06-2012, 10:49 AM | #112 |
Guru
Posts: 971
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-T2, Kindle Paperwhite 11th gen
|
|
08-06-2012, 11:29 AM | #113 |
Evangelist
Posts: 490
Karma: 1665031
Join Date: Nov 2010
Location: Vancouver Island, Nanaimo
Device: K2 (retired), Kobo Touch (passed to the wife), KGlo, Galaxy TabPro
|
|
08-06-2012, 11:51 AM | #114 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
Help with regex and chapters
I have a book I'm fixing where the chapters are named:
Code:
<p class="calibre4">1</p> <p class="calibre4">2</p> How can I change these occurences with, for instance Code:
<h3>Chapter 1</h3> <h3>Chapter 2</h3> I've tried all the combinations I know of but can't seem to get it done. Many thanks ! Paul |
08-06-2012, 12:55 PM | #115 |
Grand Sorcerer
Posts: 5,637
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
I suck at regular expressions, but this should work in Sigil 0.5.3:
Find: <p class="calibre4">(\d+)</p> Replace: <h3>Chapter \1</h3> |
08-06-2012, 12:56 PM | #116 |
Connoisseur
Posts: 54
Karma: 37363
Join Date: Aug 2011
Location: Istanbul
Device: EBW1150, Nook STR
|
@Danger: In most regex flavors dot(.) does not match newline characters by default. Your case requires the dot to match newlines. In Sigil either select Regex Dotall from the mode listbox(beta version does not have that mode iirc), or append (?s) in front of your find pattern. Example:
Code:
(?s)<div class="story" id="part-\d+">(.*)</div> |
08-06-2012, 12:59 PM | #117 |
Addict
Posts: 385
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
|
|
08-06-2012, 01:04 PM | #118 | |
Evangelist
Posts: 490
Karma: 1665031
Join Date: Nov 2010
Location: Vancouver Island, Nanaimo
Device: K2 (retired), Kobo Touch (passed to the wife), KGlo, Galaxy TabPro
|
Quote:
|
|
08-06-2012, 09:52 PM | #119 | |
Well trained by Cats
Posts: 30,419
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Code:
(?sm)<div class="story" id="part-\d+">(.*?)</div>
|
|
08-11-2012, 08:46 AM | #120 |
Gadget Freak
Posts: 1,169
Karma: 1043832
Join Date: Nov 2007
Location: US
Device: EE, Note 8
|
I would like to change the capitalization a particular phrase across a book e.g. chapter one to Chapter One. I can detect the instances using (\D+) (\D+) and know the replacement would be \1 \2, but not how to change the capitalization.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Examples of Subgroups | emonti8384 | Lounge | 32 | 02-26-2011 06:00 PM |
Accessories Pen examples | Gunnerp245 | enTourage Archive | 15 | 02-21-2011 03:23 PM |
Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 08:24 PM |
Examples | kafkaesque1978 | iRiver Story | 1 | 07-26-2010 03:49 PM |
Looking for examples of typos in eBooks | Tonycole | General Discussions | 1 | 05-05-2010 04:23 AM |