Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2023, 01:51 AM   #1
Jaws
JCL Punch-Card Collector
Jaws began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Jun 2014
Location: Antarctica
Device: Aggressively Device Independent
Split File at Cursor?

I'm probably overlooking something obvious...

I have a bad mobi source converted to ePub. I want to manually place my cursor at locations in the (7.5mb!) index.html file and split at that point. Because it's a conversion from mobi, I cannot use an xpath expression -- the option offered when placing the cursor where I want to split and then right-clicking -- to tell it where to convert (you really don't want to see some of the goofy code). Neither the Tools nor the Edit menus offer anything other than Split at Multiple Locations.

So what am I missing?
Jaws is offline   Reply With Quote
Old 03-08-2023, 02:07 AM   #2
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,166
Karma: 4917718
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by Jaws View Post
So what am I missing?
Nothing that I am aware of. That feature is not available.

There have been many times when a single split option would definitely have come in handy for me.

You just have to manually create a new xhtml file then cut and paste.
Karellen is offline   Reply With Quote
Old 03-08-2023, 02:28 AM   #3
Jaws
JCL Punch-Card Collector
Jaws began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Jun 2014
Location: Antarctica
Device: Aggressively Device Independent
Unhappy

I was afraid of that.

The only other option I can see is to manually drop fake-code markers like

<p class="splitbabyhere"></p>

into the index.xhtml file at the desired split points -- but then I still can't be sure that an xpath statement would work correctly. Since I don't use xpath for anything else, I'd almost certainly screw it up even if that's the right approach, especially working on a new machine with an oversensitive touchpad.
Jaws is offline   Reply With Quote
Old 03-08-2023, 03:08 AM   #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,091
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Look under the file preview of teh editor.
Click image for larger version

Name:	Screenshot from 2023-03-08 03-05-24.png
Views:	84
Size:	673.3 KB
ID:	200194

Click image for larger version

Name:	Screenshot from 2023-03-08 02-59-24.png
Views:	78
Size:	564.6 KB
ID:	200192

Click image for larger version

Name:	Screenshot from 2023-03-08 03-00-06.png
Views:	80
Size:	537.2 KB
ID:	200193


bernie

Quote:
Originally Posted by Jaws View Post
I'm probably overlooking something obvious...

I have a bad mobi source converted to ePub. I want to manually place my cursor at locations in the (7.5mb!) index.html file and split at that point. Because it's a conversion from mobi, I cannot use an xpath expression -- the option offered when placing the cursor where I want to split and then right-clicking -- to tell it where to convert (you really don't want to see some of the goofy code). Neither the Tools nor the Edit menus offer anything other than Split at Multiple Locations.

So what am I missing?
gbm is offline   Reply With Quote
Old 03-08-2023, 03:17 AM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,681
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
↑ ↑ ↑ ✔ - what he said

Could you use the Preview panel Split tool, viz:

Click image for larger version

Name:	Screenshot 2023-03-08 191047.jpg
Views:	70
Size:	364.4 KB
ID:	200195

BR
BetterRed is online now   Reply With Quote
Old 03-08-2023, 03:30 AM   #6
Jaws
JCL Punch-Card Collector
Jaws began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Jun 2014
Location: Antarctica
Device: Aggressively Device Independent
I apparently wasn't clear enough. I don't want to split appearance in the editor; I want to actually split the files, so that I don't have an epub consisting of a "cover" and a 7.5mb "index.xhtml."

I went ahead and did the fake-code kludge, which sort of worked. This is what I get for dealing with very-first-generation mobi files made from government documents. Now I only have seventeen other types of artifacts that make the file darned near impossible to actually read to clean up.

Being able to point-and-split-the-file-not-just-the-view would be a useful feature, though. On the other hand, the fake-code kludge sure beats the excessive file-splitting that results when converting heavily-illustrated/filled-with-tables Kindle books to epubs.
Jaws is offline   Reply With Quote
Old 03-08-2023, 03:37 AM   #7
Karellen
Wizard
Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.Karellen ought to be getting tired of karma fortunes by now.
 
Karellen's Avatar
 
Posts: 1,166
Karma: 4917718
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
Quote:
Originally Posted by gbm View Post
Look under the file preview of teh editor.
bernie
Oh, damn. I never noticed that!!
Thanks.
Karellen is offline   Reply With Quote
Old 03-08-2023, 03:40 AM   #8
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,681
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
The Preview Split feature creates a new file at each spit, viz:

Click image for larger version

Name:	Screenshot 2023-03-08 193515.jpg
Views:	74
Size:	347.7 KB
ID:	200196

Splitting HTML files

BR

Last edited by BetterRed; 03-08-2023 at 03:43 AM.
BetterRed is online now   Reply With Quote
Old 03-08-2023, 10:07 AM   #9
enuddleyarbl
Guru
enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.enuddleyarbl ought to be getting tired of karma fortunes by now.
 
enuddleyarbl's Avatar
 
Posts: 734
Karma: 1077122
Join Date: Sep 2013
Device: Kobo Forma
Eee gods! I never noticed that split feature in the Editor's Preview window either. And, thanks from me, too!
enuddleyarbl is offline   Reply With Quote
Old 03-08-2023, 11:01 AM   #10
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,979
Karma: 56143930
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 enuddleyarbl View Post
Eee gods! I never noticed that split feature in the Editor's Preview window either. And, thanks from me, too!
Don't feel bad. I had to ask where it was shortly after it came out.
theducks is offline   Reply With Quote
Old 03-08-2023, 11:08 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: 29,979
Karma: 56143930
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 Jaws View Post
I was afraid of that.

The only other option I can see is to manually drop fake-code markers like

<p class="splitbabyhere"></p>

into the index.xhtml file at the desired split points -- but then I still can't be sure that an xpath statement would work correctly. Since I don't use xpath for anything else, I'd almost certainly screw it up even if that's the right approach, especially working on a new machine with an oversensitive touchpad.
Hey I use <div class="splithere"> </div>

It works just fine
Just do whatever to place the split point markers.

The Right-click in the code:split at multiple locations:
Code:
//h:div[re:test(@class, "split_here", "i")]
After the split, you will need to bulk remove the 'marker'
theducks is offline   Reply With Quote
Old 03-08-2023, 09:09 PM   #12
Jaws
JCL Punch-Card Collector
Jaws began at the beginning.
 
Posts: 50
Karma: 10
Join Date: Jun 2014
Location: Antarctica
Device: Aggressively Device Independent
Quote:
After the split, you will need to bulk remove the 'marker'
Not so much. You have no idea just how screwed up the source file is; any bulk removal is likely to run into Problems (I tried to bulk-correct a misspelling and, 45 minutes later, Calibre exited).

I respectfully suggest that whoever designed that icon for the split-via-preview feature is both insane and has far better vision than I do. That is not an intuitive icon... and doing the split from the preview window risks incorrectly splitting other code (like the ends of tables; I did try... after someone pointed this out... and it left a hanging </table> at the top of the file because the source file doesn't have consistent vertical spacing and linebreaks).

So if it's possible to do in the preview editor, I'd like to do it in the code window, too. But I suspect that's not a high priority.
Jaws is offline   Reply With Quote
Old 03-08-2023, 11:33 PM   #13
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,681
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
If I don't like the result of a Preview split, I go to the Edit menu and choose the first item which will be something like "Revert to "Before: Split index_split_001.html"

If I don't know what an icon button does (given I'm a card-carrying iconoclast, that is 90% of the time) I hover the mouse and read the tooltip, calibre's tooltips are considerably better than most applications.

I also recommend spending time viewing the Editor video, it covers many of non-obvious features - like checkpoint/reversion of significant events - such as preview splits. And its one of the few "how to" videos I can bear to watch.

BR
BetterRed is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
File split question gtriever Conversion 6 09-09-2021 10:05 AM
can I split a file at headings? gennaro Sigil 3 12-28-2020 04:42 PM
Split at Cursor sometimes inserts multiple pages?? nzdeni Sigil 6 01-11-2020 10:36 AM
File split sometimes shows more split lines DrChiper Editor 1 12-23-2013 05:38 PM
Can I split one epub into more than one file? ChrisKaos ePub 10 04-05-2012 06:05 AM


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


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