Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 08-30-2009, 09:32 AM   #1
GJN
Guilty Bystander
GJN began at the beginning.
 
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
GJN is offline   Reply With Quote
Old 08-30-2009, 10:35 AM   #2
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,497
Karma: 424627
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
GRiker is offline   Reply With Quote
Old 08-30-2009, 10:41 AM   #3
GJN
Guilty Bystander
GJN began at the beginning.
 
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.
GJN is offline   Reply With Quote
Old 08-30-2009, 11:29 AM   #4
GRiker
Comparer of the Ephemeris
GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.GRiker ought to be getting tired of karma fortunes by now.
 
Posts: 1,497
Karma: 424627
Join Date: Mar 2009
Device: iPad
Take a look at TextWrangler - it's free, and very capable.

G
GRiker is offline   Reply With Quote
Old 08-30-2009, 04:04 PM   #5
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
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.
user_none is offline   Reply With Quote
Old 08-30-2009, 04:36 PM   #6
TMF
Enthusiast
TMF began at the beginning.
 
Posts: 40
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!
TMF is offline   Reply With Quote
Old 08-31-2009, 09:12 PM   #7
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,433
Karma: 950001
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.
user_none is offline   Reply With Quote
Old 09-04-2009, 07:40 AM   #8
GJN
Guilty Bystander
GJN began at the beginning.
 
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.
GJN is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 09:41 AM.


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