![]() |
#1 |
Guilty Bystander
![]() Posts: 104
Karma: 10
Join Date: Feb 2009
Location: Florida
Device: MacBook Pro, Kindle, iPad, and other gadgets
|
Newbie Question re txt File Conversion
Hi folks,
I'm a relatively new calibre user who's been using the software primarily as an eBook database manager for his Kindle. Now I'm trying to convert some .txt files to .mobi format and have run into a problem. Paragraphs in my .txt files end with a new line, so I've checked the "Treat each line as a paragraph" option under "TXT Input". This part works well. Each new line, however, (i.e. each paragraph) also begins with a tab and this causes calibre to switch to a Courier-style font and a shortened line length. If I delete the tab, the conversion proceeds normally. Is there a way I can get calibre to ignore the tab at the beginning of each paragraph? I guess I could reformat the whole document, but that would be a great deal of tedious work and there must be a smarter solution. I run calibre 0.6.10 on a Mac under OS X 10.5.8. Oh, and is there something I can insert between sections to force the conversion to begin a new page? Thanks very much for your help. George |
![]() |
![]() |
![]() |
#2 |
Comparer of the Ephemeris
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
|
GJN,
If you're using a text editor with reasonable search/replace functionality, you can easily run a macro to replace tabs. In order to take advantage of formatting, you will want to migrate the files to HTML format. In HTML, you can format the section heads as <h1> or <h2>, which will force page breaks at those locations. G |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Guilty Bystander
![]() Posts: 104
Karma: 10
Join Date: Feb 2009
Location: Florida
Device: MacBook Pro, Kindle, iPad, and other gadgets
|
Thanks, GRiker. I'll have to find another text editor. Mac's TextEdit doesn't do find/replaces.
|
![]() |
![]() |
![]() |
#4 |
Comparer of the Ephemeris
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,496
Karma: 424697
Join Date: Mar 2009
Device: iPad
|
|
![]() |
![]() |
![]() |
#5 |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
Calibre runs all text files though markdown. Markdown is a simple format that allows some basic formatting to be added to a text file. During conversion the markdown syntax is converted to the appropriate HTML equivalent. A tab at the beginning of the file is a markdown marking for a code block. If you could open a ticket requesting an option to remove whitespace from the beginning of lines for TXT input. That way I won't forget about adding it.
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Enthusiast
![]() Posts: 42
Karma: 10
Join Date: May 2009
Device: PRS-505
|
This has caused problems for me too. I've opened a ticket at http://calibre.kovidgoyal.net/ticket/3359. Thanks!
|
![]() |
![]() |
![]() |
#7 |
Sigil & calibre developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
I've made the changes for markdown to be optional (to enable markdown use the--markdown option). It's just waiting merging to trunk. It still defines paragraphs as being separated by a blank line. If your input file treats each line as a paragraph use the --single-line-paras option.
|
![]() |
![]() |
![]() |
#8 |
Guilty Bystander
![]() Posts: 104
Karma: 10
Join Date: Feb 2009
Location: Florida
Device: MacBook Pro, Kindle, iPad, and other gadgets
|
Thanks, all. I've gotten and successfully used TextWrangler and I appreciate knowing about markdown.
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
conversion to txt or rtf makes empty file | lunixer | Calibre | 10 | 08-25-2010 04:56 PM |
Conversion: EPUB to TXT | Starson17 | Calibre | 11 | 05-29-2010 12:31 PM |
How can i convert HTML or txt file to EPUB file ? | guguqiaqia | ePub | 7 | 05-28-2010 09:15 PM |
iLiad Newbie Question on updates (V2.12 and zip file) | Teneflin | iRex Developer's Corner | 2 | 02-10-2008 09:05 PM |
Batch conversion of txt | BlackVoid | Sony Reader | 8 | 11-17-2007 09:53 PM |