Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-06-2015, 02:30 AM   #1
Kaetrin
Connoisseur
Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.
 
Kaetrin's Avatar
 
Posts: 82
Karma: 9402
Join Date: Jul 2009
Location: Adelaide, South Australia
Device: Kobo Libra Colour
Easy way to edit out numbers in ebook?

Hi, I have an ebook which I've converted from PDF to epub. It's coming up with annoying numbers on every line. Is there an easy way I can delete these numbers so my copy is clean (and therefore easy to read)? I just want to be able to read it without tearing my hair out.

eg of my current view:

before dark most of the time, and the University of Texas at Austin 15

is one of the biggest colleges in the nation, meaning people are 16



The numbers are at the end of every line.

Any suggestions would be welcome. Thx.
Kaetrin is offline   Reply With Quote
Old 07-06-2015, 08:20 AM   #2
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: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
in the Editor. Search and Replace


WARNING
'What if'...
there is a real (text) number at line end?


(codeview) REGEX mode S&R (assumes no </span></p> ending

\s\d+</p>

</p>
theducks is offline   Reply With Quote
Advert
Old 07-06-2015, 08:52 PM   #3
Kaetrin
Connoisseur
Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.
 
Kaetrin's Avatar
 
Posts: 82
Karma: 9402
Join Date: Jul 2009
Location: Adelaide, South Australia
Device: Kobo Libra Colour
Thank you.

For the sake of argument however, let's pretend I'm still confused.

What, exactly do I put in the "find" section of the editor and which bit do I put in the "replace" part of the editor.

I've tried various combinations but I'm obviously not getting it right because Calibre keeps telling me it can't find what I'm searching for. Leaving it blank means I get an error message that I have to find something first.

Thx!
Kaetrin is offline   Reply With Quote
Old 07-06-2015, 09:40 PM   #4
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,188
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Kaetrin View Post
Thank you.

For the sake of argument however, let's pretend I'm still confused.

What, exactly do I put in the "find" section of the editor and which bit do I put in the "replace" part of the editor.

I've tried various combinations but I'm obviously not getting it right because Calibre keeps telling me it can't find what I'm searching for. Leaving it blank means I get an error message that I have to find something first.

Thx!
Find
Code:
\s\d+</p>
replace
Code:
</p>
Make sure you are using:
Mode: Regex All text files

bernie
gbm is offline   Reply With Quote
Old 07-06-2015, 09:48 PM   #5
Kaetrin
Connoisseur
Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.
 
Kaetrin's Avatar
 
Posts: 82
Karma: 9402
Join Date: Jul 2009
Location: Adelaide, South Australia
Device: Kobo Libra Colour
Thank you. I have put the editor on Regex Mode with All Text Files. However, when I do a search, I get a message that there is no text which matches my search criteria.

I've copied out a couple of lines from what I see in the editor:
<span class="bold">The next morning,</span>I keep myself busy at the university. Exams are<br class="calibre1"/>
<span class="calibre_1">14</span> upon us, which means I have to lead two exam-review sessions,<br class="calibre1"/>
<span class="calibre_1">15

Does the above change the search criteria?
Kaetrin is offline   Reply With Quote
Advert
Old 07-06-2015, 10:12 PM   #6
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,188
Karma: 8888888
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by Kaetrin View Post
Thank you. I have put the editor on Regex Mode with All Text Files. However, when I do a search, I get a message that there is no text which matches my search criteria.

I've copied out a couple of lines from what I see in the editor:
<span class="bold">The next morning,</span>I keep myself busy at the university. Exams are<br class="calibre1"/>
<span class="calibre_1">14</span> upon us, which means I have to lead two exam-review sessions,<br class="calibre1"/>
<span class="calibre_1">15

Does the above change the search criteria?
Yes it does.
I started with this
Spoiler:
Code:
<body>

<span class="bold">The next morning,</span>I keep myself busy at the university. Exams are<br class="calibre1"/>
<span class="calibre_1">14</span> upon us, which means I have to lead two exam-review sessions,<br class="calibre1"/>
<span class="calibre_1">15
</body>
used this regex
find
Code:
<br class="calibre1"/>
<span class="calibre_1">\d+
left the replace blank and got this
Code:
<span class="bold">The next morning,</span>I keep myself busy at the university. Exams are</span> upon us, which means I have to lead two exam-review sessions,
</body>
Then did a Fix html and got this:
Code:
<span class="bold">The next morning,</span>I keep myself busy at the university. Exams are upon us, which means I have to lead two exam-review sessions,


</body></html>


bernie
gbm is offline   Reply With Quote
Old 07-06-2015, 11:01 PM   #7
Kaetrin
Connoisseur
Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.
 
Kaetrin's Avatar
 
Posts: 82
Karma: 9402
Join Date: Jul 2009
Location: Adelaide, South Australia
Device: Kobo Libra Colour
Thank you

This is what I did:

I typed the entire code into "find" <br class="calibre1"/>
<span class="calibre_1">\d+ and replaced it with blank

There were still numbers so then I typed just <span class="calibre_1">\d+ into "find" and replaced with blank.

There were less numbers so then I typed just <br class="calibre1"/> into "find" and replaced with blank. There were fewer numbers but also no paragraph markers at all (just a huge block of text) so I undid that find/replace.

Then I closed out of the find/replace mode and clicked on Fix HTML. I'm not familiar with this function. I can see it did something but I'm not sure exactly what.

It is much better than it was. Possibly even largely readable now but there are still some numbers.

Here is an example of what I see in live preview:
“I’m not going to back down,” Maddox insists. The glowing S31
numbers over the doors mark ever-higher stories; I swallow to pop N32
01 my ears.

And here is the same passage in Regex mode:
“I’m not going to back down,” Maddox insists. The glowing <span class="calibre_1">S31</span><br class="calibre1"/> numbers over the doors mark ever-higher stories; I swallow to pop <span class="calibre_1">N32</span><br class="calibre1"/><span class="calibre_1"> 01</span> my ears.

Obviously I've not managed to follow your instructions correctly. Can you point me to what I did wrong?

Sorry, I know I'm hard work. This stuff is a bit above my paygrade. I really appreciate your help.
Kaetrin is offline   Reply With Quote
Old 07-06-2015, 11:11 PM   #8
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: 31,062
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
See, what you posted originally (book view) did not really represent your problem.

Always ALSO Include the code like you did


2 Steps (could do in one... but simpler this way)

I would remove JUST the number and leave the rest

Code:
<span class="calibre_1">\d+</span>\s
Replace: (a single space)
See what this look like in Book (preview) View

Not enough code for the second part: for removing the <br class="calibre1"/>

OK, you could stop and leave the lines ragged (not flowing cleanly) because the next phase is tricky work.

If you see <br class="calibre1"/> <br class="calibre1"/>
this needs to be replaced FIRST as these are simulated Paragraph breaks If in the text part

replace the pairing with the (you did not show that code ) ></p>\s*<p class="calibre_"><

NOTE: you are ENDING the previous <P and Starting the NEXT <P (AKA Splitting). THERE WILL BE PROBLEMS, Usually around the Headings. you just need to learn how to fix code. (This is not an easy cleanup)

Once the double breaks are done

You want to remove the rest of the <br class="calibre1"/>\s and replace those with a single space. You should end with a Paragraph that flows

Last edited by theducks; 07-07-2015 at 10:06 AM. Reason: actual code
theducks is offline   Reply With Quote
Old 07-06-2015, 11:21 PM   #9
Kaetrin
Connoisseur
Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.
 
Kaetrin's Avatar
 
Posts: 82
Karma: 9402
Join Date: Jul 2009
Location: Adelaide, South Australia
Device: Kobo Libra Colour
I tried the first find/replace you suggested but it didn't remove the numbers.

I'm sorry I didn't post enough at the start to fully explain my issue. It wasn't until I started to try and fix it and I got into the edit book function (it's not an area I usually play in).

I've been reluctant to post too much because of copyright concerns.

You said "Not enough code for the second part: for removing the <br class="calibre1"/>"

Is this enough?

</head>
<body class="calibre">
<p class="calibre_"><span class="calibre2"><span class="bold">Ten</span></span></p><p class="calibre_"><span class="calibre_1">09</span><br class="calibre1"/><span class="calibre_1"> 10</span><br class="calibre1"/><span class="calibre_1"> 11</span><br class="calibre1"/><span class="calibre_1"> 12</span><br class="calibre1"/>
<span class="bold">“So this is </span>the famous <span class="italic">Joooooooo-nah</span>,” Liz says, subtle as a light<span class="calibre_1">13</span><br class="calibre1"/> ning strike. She shifts her white wine into her other hand so she <span class="calibre_1">14</span><br class="calibre1"/> can shake Jonah’s. All around us, family friends and Chloe’s pals <span class="calibre_1">15</span><br class="calibre1"/> mill around in cocktail dresses and suits; Christmas music plays <span class="calibre_1">16</span><br class="calibre1"/> just loud enough to be heard amid the buzz of the crowd. Liz’s grin <span class="calibre_1">17</span><br class="calibre1"/> is brighter than the chandelier overhead. “I’ve heard so much <span class="calibre_1">18</span><br class="calibre1"/> about you, Mr. Marks! Can’t wait to find out if it’s true.”

Same text in live preview:
Ten
09
10
11
12
“So this is the famous Joooooooo-nah,” Liz says, subtle as a light13
ning strike. She shifts her white wine into her other hand so she 14
can shake Jonah’s. All around us, family friends and Chloe’s pals 15
mill around in cocktail dresses and suits; Christmas music plays 16
just loud enough to be heard amid the buzz of the crowd. Liz’s grin 17
is brighter than the chandelier overhead. “I’ve heard so much 18
about you, Mr. Marks! Can’t wait to find out if it’s true.”

Note: This is after I have done the find/replace with <span class="calibre_1">\d+</span>\s
Kaetrin is offline   Reply With Quote
Old 07-07-2015, 04:30 AM   #10
HarryT
eBook Enthusiast
HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.HarryT ought to be getting tired of karma fortunes by now.
 
HarryT's Avatar
 
Posts: 85,544
Karma: 93383099
Join Date: Nov 2006
Location: UK
Device: Kindle Oasis 2, iPad Pro 10.5", iPhone 6
If this book is available as a commercial ebook, would it not be a better use of your time simply to buy it, rather than go through all this effort in converting what seems to be a very poor quality PDF?
HarryT is offline   Reply With Quote
Old 07-07-2015, 10:03 AM   #11
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: 31,062
Karma: 60358908
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 HarryT View Post
If this book is available as a commercial ebook, would it not be a better use of your time simply to buy it, rather than go through all this effort in converting what seems to be a very poor quality PDF?
+1

Is this a Galley Proof? There is a LOT of steps to clean that mess up


I will edit my previous post with actual code
theducks is offline   Reply With Quote
Old 07-08-2015, 02:36 AM   #12
Kaetrin
Connoisseur
Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.
 
Kaetrin's Avatar
 
Posts: 82
Karma: 9402
Join Date: Jul 2009
Location: Adelaide, South Australia
Device: Kobo Libra Colour
Yes, it's a galley proof. It's not available for purchase yet.
Kaetrin is offline   Reply With Quote
Old 07-08-2015, 02:41 AM   #13
Kaetrin
Connoisseur
Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.Kaetrin can eat soup with a fork.
 
Kaetrin's Avatar
 
Posts: 82
Karma: 9402
Join Date: Jul 2009
Location: Adelaide, South Australia
Device: Kobo Libra Colour
Thank you everyone. I have it to a state where it is readable now.
Kaetrin is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there an easy way to add pictures to an ebook? ficbot General Discussions 3 02-18-2011 03:44 PM
ebook piracy numbers sassanik General Discussions 212 08-21-2010 02:41 AM
ebook en easy english ? superouioui E-Books 22 11-05-2009 05:58 PM


All times are GMT -4. The time now is 10:18 PM.


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