![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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> Code:
<p>\d+</p> For upper case roman numerals use: Code:
<p>[MDCLXVI]+</p> For more examples, see the Sigil Regex thread. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,704
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
|
For Arabic numerals try:
Code:
<div class=".*?">\s*\d+\.*\s*</div> Code:
<div class=".*?">\s*[MDCLXVI]+\.*\s*</div> |
![]() |
![]() |
![]() |
#5 |
Sharpest Tool On Shelf
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?
|
![]() |
![]() |
![]() |
#7 | |
Sharpest Tool On Shelf
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 656
Karma: 2586302
Join Date: Feb 2009
Location: Downunda
Device: Kindles, Kobo & Samsung Tablet
|
![]() Quote:
![]() 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. |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |