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 06-18-2011, 03:44 PM   #1
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,649
Karma: 5071814
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Tidy use and issue

I was cleaning up a book that started out as nearly pure text and was taking advantage of tidy.

Here is some of my experiences: I found a way to identify some text so that I could change an entire book with find and replace:

I made a span around some leading text and tidy make the /span at the end of the paragraph. I made a /span where I really needed it and tidy removed the one it built. Note that the first time I tried to put the /span in first but tidy removed it. the order is important.

Later I need to change certain paragraphs (chapters) to h3 so they would go in the TOC. I searched and replaced <p>Chapter ... with <h3>Chapter ... and expected tidy to fix the /h3 which it did. However, in a retro work around design dating back to html version 3 before css it also decided to add spacing so my file now looks like:

<h3>Chapter text<br />
<br /></h3>

Stupid tidy, a bug that needs fixing. However, now I have all these extra breaks. I am no expert on using regular expressions and this one has to cross a CR/LF sequence on my PC. How can a code the find to find and select both breaks?

Dale
DaleDe is offline   Reply With Quote
Old 06-18-2011, 04:06 PM   #2
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 15,518
Karma: 13575467
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Quote:
Originally Posted by DaleDe View Post
I was cleaning up a book that started out as nearly pure text and was taking advantage of tidy.

Here is some of my experiences: I found a way to identify some text so that I could change an entire book with find and replace:

I made a span around some leading text and tidy make the /span at the end of the paragraph. I made a /span where I really needed it and tidy removed the one it built. Note that the first time I tried to put the /span in first but tidy removed it. the order is important.

Later I need to change certain paragraphs (chapters) to h3 so they would go in the TOC. I searched and replaced <p>Chapter ... with <h3>Chapter ... and expected tidy to fix the /h3 which it did. However, in a retro work around design dating back to html version 3 before css it also decided to add spacing so my file now looks like:



<h3>Chapter text<br />
<br /></h3>

Stupid tidy, a bug that needs fixing. However, now I have all these extra breaks. I am no expert on using regular expressions and this one has to cross a CR/LF sequence on my PC. How can a code the find to find and select both breaks?

Dale
I may be off base, but the following should work (it works in epp )

Find:
Code:
<h3>([^~]+?)<br />
<br /></h3>
Replace:
Code:
<h3>\1></h3>

Last edited by crutledge; 06-18-2011 at 04:15 PM.
crutledge is offline   Reply With Quote
 
Enthusiast
Old 06-18-2011, 04:22 PM   #3
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,649
Karma: 5071814
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
How can I input two lines in the Find? The find inside Sigil only allows one line. That is the problem I am having.
DaleDe is offline   Reply With Quote
Old 06-18-2011, 04:41 PM   #4
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: 741
Karma: 3058207
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by DaleDe View Post
How can I input two lines in the Find? The find inside Sigil only allows one line. That is the problem I am having.
Something I think has worked for me in the past: just select what you want to search for in Code View, including both lines. Copy and paste into the search box. Hope it helps.
Pablo is offline   Reply With Quote
Old 06-18-2011, 04:56 PM   #5
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,649
Karma: 5071814
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Quote:
Originally Posted by Pablo View Post
Something I think has worked for me in the past: just select what you want to search for in Code View, including both lines. Copy and paste into the search box. Hope it helps.
Wow, that worked. Thanks a lot.

Dale
DaleDe is offline   Reply With Quote
Old 06-18-2011, 04:59 PM   #6
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: 741
Karma: 3058207
Join Date: Mar 2009
Location: Rosario, Argentina
Device: SONY PRS-505, PRS-T2
Quote:
Originally Posted by DaleDe View Post
Wow, that worked. Thanks a lot.

Dale
I'm glad it worked!!!
Pablo is offline   Reply With Quote
Old 06-18-2011, 07:41 PM   #7
theducks
Grand Sorcerer
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: 14,841
Karma: 5654321
Join Date: Aug 2009
Location: (The original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
Quote:
Originally Posted by DaleDe View Post
How can I input two lines in the Find? The find inside Sigil only allows one line. That is the problem I am having.
Ignore the 2 line thinking
Use \s+ at the place of the EOL would be. Actually, I use it to search everywhere there was white space (except when I deliberately want to find a set number of spaces)
Code:
<h3>Chapter (.+)<br />\s+
<br />\s+</h3>
Note the Paren for the back reference \1 below

<h3>Chapter \1</h3>
theducks is online now   Reply With Quote
Old 06-19-2011, 07:22 PM   #8
DaleDe
Grand Sorcerer
DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.DaleDe ought to be getting tired of karma fortunes by now.
 
DaleDe's Avatar
 
Posts: 9,649
Karma: 5071814
Join Date: Aug 2007
Location: Grass Valley, CA
Device: EB 1150, EZ Reader, Literati, iPad 2
Thanks for the \s+ I was wondering what to use. I will give this a try next time I hit a problem like this. For now I am good.

Dale
DaleDe 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
Love Sigil, Hate HTML Tidy Danger Sigil 2 12-25-2010 08:00 PM
tidy still helping me - sigh... bobcdy Sigil 2 12-19-2010 07:14 PM
Sigil, HTML Tidy or PEBCAK? DTM Sigil 6 09-26-2010 08:49 PM
HTML Tidy problems pdurrant Sigil 2 04-08-2010 07:38 AM
0.5.2 Issue drmathprog Calibre 3 03-25-2009 10:33 PM


All times are GMT -4. The time now is 04:13 PM.


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