Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 06-12-2016, 01:52 AM   #1
leftright
Addict
leftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplane
 
Posts: 224
Karma: 55704
Join Date: Sep 2013
Device: Kobo Glo
syntax for removing numbers between lines please

I would like to remove the numbers between lines in a quatrain. The numbers increase up to 500. numbering is punctuated, e.g. 1. 2. 3. 4. ... 500.

The same syntax for removing Roman Numerals from I to CI. (1 to 500).

In both cases I would like to replace the numbers with a blank line.

Many thanks.
Attached Thumbnails
Click image for larger version

Name:	regex_remove_2.jpg
Views:	235
Size:	20.6 KB
ID:	149349  
leftright is offline   Reply With Quote
Old 06-12-2016, 02:45 AM   #2
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,704
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Without seeing the HTML code it's hard to suggest a search a proper regex.
Switch to code view mode and locate the number. If it looks like this:

Code:
<p>55</p>
select the regular expression mode (Regex) and use the following expression:

Code:
<p>\d+</p>
and replace with nothing.

For upper case roman numerals use:

Code:
<p>[MDCLXVI]+</p>
Note that you can't use this expression with replace all, because it might also match certain upper case words.

For more examples, see the Sigil Regex thread.
Doitsu is offline   Reply With Quote
Advert
Old 06-12-2016, 03:41 AM   #3
leftright
Addict
leftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplaneleftright makes transoceanic flights without the assistance of an airplane
 
Posts: 224
Karma: 55704
Join Date: Sep 2013
Device: Kobo Glo
Many thanks for your prompt reply.

I've attached the code for both examples.
Attached Thumbnails
Click image for larger version

Name:	regex2sample.jpg
Views:	269
Size:	11.3 KB
ID:	149354   Click image for larger version

Name:	regex_roman.jpg
Views:	254
Size:	6.4 KB
ID:	149355  
leftright is offline   Reply With Quote
Old 06-12-2016, 04:52 AM   #4
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,704
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
For Arabic numerals try:

Code:
<div class=".*?">\s*\d+\.*\s*</div>
For Roman numerals try:

Code:
<div class=".*?">\s*[MDCLXVI]+\.*\s*</div>
Both are quick & dirty expressions that shouldn't be used with Replace All, because they might produce unwanted matches.
Doitsu is offline   Reply With Quote
Old 09-07-2016, 07:59 AM   #5
Timboli
Sharpest Tool On Shelf
Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.
 
Timboli's Avatar
 
Posts: 656
Karma: 2586302
Join Date: Feb 2009
Location: Downunda
Device: Kindles, Kobo & Samsung Tablet
@leftright - like you, I wanted to remove page numbers. I also wanted to correct issues of broken sentences, especially where page numbers occurred, but not only then ... and sometimes the page number was at the end of the first half of a split sentence, so not on a line of its own. Because I program for a hobby, I whipped up a little program to help with these issues and more, called 'Sigil Assistant'. If anyone is interested in it, I can provide a link ... once I upload it to the AutoIt Forum ... where I have been a well respected member for many years, called TheSaint. You can even contact me there if you wish, and also checkout my KindEbook Wishlist program.

In short, my Sigil Assistant program can do an incrementing number removal and reconnection of broken sentences, at the click of a button per instance, etc.
Timboli is offline   Reply With Quote
Advert
Old 09-07-2016, 08:33 AM   #6
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,508
Karma: 204127028
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
@Timboli: Have you considered making your program a Sigil plugin and making it available here?
DiapDealer is offline   Reply With Quote
Old 09-08-2016, 04:59 AM   #7
Timboli
Sharpest Tool On Shelf
Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.Timboli ought to be getting tired of karma fortunes by now.
 
Timboli's Avatar
 
Posts: 656
Karma: 2586302
Join Date: Feb 2009
Location: Downunda
Device: Kindles, Kobo & Samsung Tablet
Smile

Quote:
Originally Posted by DiapDealer View Post
@Timboli: Have you considered making your program a Sigil plugin and making it available here?
I would, but I only code in AutoIt.
Others are welcome to adapt my code (source in zip).

Sigil Assistant v1.5.zip

P.S. My disclaimer is you use my programs at your own risk. That said, just use the Sigil UNDO option to undo any change you didn't want, while testing etc. If you assign the working epub file, you will also get auto backups every time SAVE is clicked, provided at least 5 minutes has gone by (it is up to the user to remove backups afterward). NOTE - For options to work with the active Sigil window, ensure only one ebook page is open. That and other information, can be found in the Program Information dialog.

My KindEbook Wishlist program can be found here

Last edited by Timboli; 09-08-2016 at 05:22 AM.
Timboli is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Old Thread] Removing page numbers. ChaoZ Calibre 8 10-20-2014 03:02 PM
Removing Page Numbers ManosHandsOfFate Calibre 6 09-28-2010 12:12 PM
Removing header syntax. boromirofborg Calibre 0 07-21-2010 12:33 AM
Removing page numbers? Cap.T Calibre 1 02-21-2010 09:57 AM
Removing blank lines between paragraphs? corroonb Workshop 3 08-13-2009 04:23 PM


All times are GMT -4. The time now is 07:35 AM.


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