Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-04-2012, 03:59 AM   #106
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
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.
Jellby is offline   Reply With Quote
Old 07-04-2012, 08:02 PM   #107
mrjoeyman
Junior Member
mrjoeyman began at the beginning.
 
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: ¬
mrjoeyman is offline   Reply With Quote
Old 07-05-2012, 04:26 AM   #108
Jellby
frumious Bandersnatch
Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.Jellby ought to be getting tired of karma fortunes by now.
 
Jellby's Avatar
 
Posts: 7,514
Karma: 18512745
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: #, ~, @...
Jellby is offline   Reply With Quote
Old 07-07-2012, 12:05 AM   #109
signum
Zealot
signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.signum calls his or her ebook reader Vera.
 
Posts: 119
Karma: 64428
Join Date: Aug 2011
Device: none
Quote:
Originally Posted by mrjoeyman View Post
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.
Assuming you are in insert (or append) mode in vim:

<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.
signum is offline   Reply With Quote
Old 07-07-2012, 09:49 AM   #110
mrjoeyman
Junior Member
mrjoeyman began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Jul 2012
Device: Kindle Fire
Thanks, you are right, simple is better
mrjoeyman is offline   Reply With Quote
Old 08-06-2012, 10:22 AM   #111
Danger
Evangelist
Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.
 
Danger's Avatar
 
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>
I've tried:
FIND
Code:
<div class="story" id="part-\d+">(.*?)</div>
&
Code:
<div class="story" id="part-\d+">(.*)</div>
and a few other variations but Sigil always returns a zero count. Just wondering what I am doing wrong. This isn't the first time I've run into this problem. Before I've just worked around it by working with much smaller bits but I'd like to know just what it is I am doing wrong because as far as I can tell that should work. Using Sigil 0.5.902

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.
Danger is offline   Reply With Quote
Old 08-06-2012, 10:49 AM   #112
Pablo
Guru
Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.Pablo ought to be getting tired of karma fortunes by now.
 
Pablo's Avatar
 
Posts: 970
Karma: 4999999
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by Danger View Post
Code:
<div class="story" id="part-\d+">(.*?)</div>
Try this:

Code:
<div class="story" id="part-[0-9]+">(.*?)</div>
Pablo is offline   Reply With Quote
Old 08-06-2012, 11:29 AM   #113
Danger
Evangelist
Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.
 
Danger's Avatar
 
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:
Originally Posted by Pablo View Post
Try this:

Code:
<div class="story" id="part-[0-9]+">(.*?)</div>
Checked it on a backup (I'd already cleaned up the code on my working copy) but I still get "no matchs found" in v0.5.902. But thanks, that was one variation I hadn't tried yet.
Danger is offline   Reply With Quote
Old 08-06-2012, 11:51 AM   #114
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Question 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>
...and so on.

How can I change these occurences with, for instance
Code:
<h3>Chapter 1</h3>
<h3>Chapter 2</h3>
...and so on?

I've tried all the combinations I know of but can't seem to get it done.

Many thanks !
Paul
paulfiera is offline   Reply With Quote
Old 08-06-2012, 12:55 PM   #115
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,582
Karma: 22735033
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>
Doitsu is offline   Reply With Quote
Old 08-06-2012, 12:56 PM   #116
Timur
Connoisseur
Timur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five wordsTimur can name that ebook in five words
 
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>
Timur is offline   Reply With Quote
Old 08-06-2012, 12:59 PM   #117
paulfiera
Addict
paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.paulfiera could sell banana peel slippers to a Deveel.
 
paulfiera's Avatar
 
Posts: 378
Karma: 3102
Join Date: Dec 2010
Location: EU
Device: Kobo Aura ONE, Kobo Libra H20
Quote:
Originally Posted by Doitsu View Post
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>
Many thanks, Doitsu.

It definitely worked !
paulfiera is offline   Reply With Quote
Old 08-06-2012, 01:04 PM   #118
Danger
Evangelist
Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.Danger ought to be getting tired of karma fortunes by now.
 
Danger's Avatar
 
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:
Originally Posted by Timur View Post
@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>
Awesome, I knew it wasn't matching newlines but couldn't figure out how to get it to do so. Thank you Timur, that works great.
Danger is offline   Reply With Quote
Old 08-06-2012, 09:52 PM   #119
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,659
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by Danger View Post
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>
I've tried:
FIND
Code:
<div class="story" id="part-\d+">(.*?)</div>
&
Code:
<div class="story" id="part-\d+">(.*)</div>
and a few other variations but Sigil always returns a zero count. Just wondering what I am doing wrong. This isn't the first time I've run into this problem. Before I've just worked around it by working with much smaller bits but I'd like to know just what it is I am doing wrong because as far as I can tell that should work. Using Sigil 0.5.902

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.
You need to tell it it is multiline

Code:
(?sm)<div class="story" id="part-\d+">(.*?)</div>
theducks is offline   Reply With Quote
Old 08-11-2012, 08:46 AM   #120
Gunnerp245
Gadget Freak
Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.Gunnerp245 ought to be getting tired of karma fortunes by now.
 
Gunnerp245's Avatar
 
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.
Gunnerp245 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

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


All times are GMT -4. The time now is 02:47 AM.


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