Log in

View Full Version : fixing eBook Formats


dMores
09-14-2003, 03:19 PM
Does anyone else have this problem?

I download eBooks, most of the ones i find are in PDF or TXT format.
so i copy the content to word, and export as .LIT.

but since the text files usually have the same line-breaks as the original book, the .LIT file looks pretty bad on my pda.

is there any way of getting rid of these "normal" line breaks without messing up the "needed" ones?

Dazbot
09-14-2003, 08:15 PM
I used Word's find and replace to find the breaks and remove them, it works very well.

davidspalding
09-19-2003, 07:29 PM
You can write a macro (or record one) in Word which does the following, I've done this for > 10 years with great success.

Replace all ^p => ^l
Replace all ^l^l => ^p
Replace all ^l => <nothing>

^p and ^l are special character codes in Word's find/replace dialog. There are others you can select from a drop list, I think (depending on version of Office, YMMV).

8)

dMores
11-13-2004, 01:35 AM
erm ... i never said thank you.

i just started converting a bunch of ebooks since i'm going away on a trip, and i did it waaaay too complicated.

your tip works great.

but i'd like to keep some of the double-paragraphs, especially in dialogues, so i think i'd stick with the way i did it.

but ... i have no idea how to program a macro.

could you give me a rough intro on how i automate all this ?

thanks, daniel

EDIT:
well, i just figured it out myself! just press record :)

if anyone is interested, here's the code. Create a new macro, and paste this into it. i think you do it in the visual basic editor.

Sub ebook()
'
' ebook Makro
' Makro aufgezeichnet am 13.11.2004 von Daniel Mores
'
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = "^p^p"
.Replacement.Text = "DOPPELBREAK"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = ".^p"
.Replacement.Text = "NORMALERBREAK"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "^p"
.Replacement.Text = "SINNLOSERBREAK"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "SINNLOSERBREAK"
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "NORMALERBREAK"
.Replacement.Text = ".^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = "DOPPELBREAK"
.Replacement.Text = "^p^p"
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
With Selection.Find
.Text = " "
.Replacement.Text = " "
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
End Sub