09-01-2010, 02:57 PM | #1 |
~~~~~
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
|
Lines became paragraphs after .lit to .mobi conversion
First, thanks so much for Calibre and all these informative threads. As a newbie, I'd have been lost without all of you.
I've finally found a problem I can't find the answer to. I converted an old .lit ebook I had to .mobi, and every line became a paragraph. What is the most efficient way to remove those line feeds (assuming that's what they are - I think my sister used Word to save to .lit), without losing all paragraphs? Thanks! |
09-01-2010, 04:33 PM | #2 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
Every problem has at least three solutions.
The quick and dirty: Convert to txt and from txt to mobi. In the final step make sure that the option to "Treat each line as a paragraph", in preferences for TXT input, is not activated. The "dirty" part is that you will loose all other formatting. The slow but "better" way: Convert to html and do a series of search-and-replaces using a good editor. That is the tricky part. You will have to examine the html to see what searches will work. First try to do find and replaces on all the correct paragraph tags and replace them with a special mark, like "PARASTART" and "PARAEND" there. Then remove all para tags. And replace PARASTRAT with a start paragraph tag, and PARAEND with a and paragraph tag. It might be easier to start by doing a search-and-replace for all the bad paragraph tags, and replacing them with a space instead. Whatever works... Finally convert to mobi. The third way is the lazy way. Ignore the problem or get someone else to fix it. Ask your sister to fix the word-file so the paragraphs are right from the start. |
Advert | |
|
09-01-2010, 05:27 PM | #3 |
~~~~~
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
|
Thanks, Adoby. I was afraid of that. lol
I was hoping Calibre had a switch for it, or maybe Sigil would. (I haven't installed Sigil, but would if it would help.) Anyway, I'll go try the second way first, and if it's too tedious, I'll go for the first. - edit - Ack. I don't see HTML as an option to convert to. Last edited by Piper_; 09-01-2010 at 05:29 PM. |
09-01-2010, 09:00 PM | #4 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
I just ran into this for some lit files of my own, and have been working on some tweaks to calibre to fix this with the preprocess option. I can try to get the changes checked in so they get in one of the next couple releases.
|
09-01-2010, 09:21 PM | #5 | |
Grand Sorcerer
Posts: 6,216
Karma: 16534894
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
Quote:
Enter the name of a directory on the Debug page. After the conversion has finished ignore the MOBI and go and look in the Input sub-directory of your named Debug directory. It will contain the HTML extracted from your LIT. Then edit away. Once it's clean reimport the HTML into Calibre and use this as your master source rather than the LIT. |
|
Advert | |
|
09-01-2010, 09:25 PM | #6 |
Resident Curmudgeon
Posts: 76,049
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
The best way to do this is to convert to ePub using no margins. Then fix up the ePub and once it's fixed up, convert to Mobipocket from there.
|
09-01-2010, 09:31 PM | #7 |
~~~~~
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
|
Thanks, Jackie. I'll give that a shot.
|
09-01-2010, 09:34 PM | #8 |
~~~~~
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
|
JSWolf, that sounds even better! I'll try that first. lol
|
09-14-2010, 11:00 AM | #9 |
Resident Curmudgeon
Posts: 76,049
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
09-16-2010, 08:31 PM | #10 |
~~~~~
Posts: 761
Karma: 1278391
Join Date: Aug 2010
Location: USA
Device: Kindle 3, Sony 350
|
It didn't. There was a </p> <p> duo between every line. Worse, it was the same single duo between paragraphs, so compressing sentences meant losing paragraphs too.
I'm sure she just hit the wrong setting in Word when she converted to .lit, so I asked her to redo it for me. She said she would. We'll see. Thanks for asking, JS. |
09-17-2010, 01:32 AM | #11 |
Wizard
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
|
Did you try enabling the preprocess option under structure detection? One of the things it does is attempt to fix lit files that are formatted like this.
I think that the code may not have been checked in when you initially posted this, so it may not have worked then, but it is now. |
09-19-2010, 05:11 PM | #12 |
Resident Curmudgeon
Posts: 76,049
Karma: 134368292
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Word made LIT files can be a real mess. The best way to handle it is to use Calibre to convert to OEB and then fix up the mess and then try to convert to ePub.
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Blank lines between paragraphs? | ascherjim | OpenInkpot | 30 | 12-03-2009 12:19 AM |
Removing blank lines between paragraphs? | corroonb | Workshop | 3 | 08-13-2009 04:23 PM |
Preserving TOC upon conversion from Lit to Mobi | mobelby | Calibre | 0 | 07-31-2009 07:59 AM |
Insert Blank Lines Between Paragraphs | Timoleon | Calibre | 14 | 03-22-2009 02:43 PM |
How to eliminate blank lines between paragraphs with Calibre | Mr. Goodbar | Calibre | 8 | 06-02-2008 07:39 AM |