Saturday, September 26, 2009

Creating Kindle Files from Plain Text on a Mac

I really like the Kindle 2 my wife got me and one of the best parts about it is how easy it is to get text files onto it (especially because of all the free books in plain text format at sites like Project Gutenberg and Christian Classics Ethereal Library).  When I first got the Kindle I wasn't real sure how easy it would be to read text on a screen.  I've tried reading text on all sorts of screens over the years and I could never get through an entire book without feeling like I was reading it off of a screen.  That's important to me.  When I really get into a book I seem to forget that I'm actually reading something and just meld with the book.  If you're a reader I think you'll understand this.  When I used to read books off a screen I never got that feeling of really being a part of what was happening in the book and it made it hard to keep reading so I rarely finished books I was trying read on the computer, for instance.

The Kindle doesn't have this problem.  I've read through many books on the Kindle now and it feels like reading it from the printed page.  The other thing that has happened with the Kindle is that it has effectively killed my Barnes and Noble addiction.  Unfortunately I think it has worked by replacing one strong drug with a stronger one.  This is because I have found with the Kindle that the "bookstores" of free books on the web and being able to browse through Amazon's Kindle Store using the built-in cellular connection are working well as feeds to the book addiction I have - better even than a Barnes and Noble or Borders because of the extremely wide availability of material.

Now, reading plain text on a computer screen is just awful.  It is worse than trying to read nicely formatted text on a computer screen.  And reading an entire novel this way just a non-starter for me.  But reading plain text on a Kindle is another story entirely.  So here is how to get a plain text book off of a site and onto the Kindle.  I wrote this on a Mac but there are directions for doing in in Windows at other sites and you can use the same steps on a Windows system as well since there is a version of Stanza for Windows as well.  Also, you don't have to use Stanza at all if you just want to copy the text files directly over (although you'll still probably want to remove the line endings).
  1. You'll need to download Lexcycle's Stanza application if you don't have it already.  Yes, it is free.  Everything in this blog post is free.  You'll also need a text editor that can remove line endings.  I used TextWrangler, which is also free (see?), for this.  Some smarty pants may point out ways of doing this with TextEdit but I'm lazy and TextWrangler has this nice selection in a menu, making all of this a snap.
  2. Choose the text file you want to transfer and save it somewhere accessible.  In this example we will take The Wind in the Willows and put it on the Kindle.  Navigate to Project Gutenberg's page for The Wind in the Willows.
  3. Go to the bottom of the page where the links are and grab one of the ones in Plain Text format with a compression of "none".  To do this, Ctrl-Click the link for downloading plain text and select Save Link As... to save the file somewhere you can get to it later.
  4. Now, open the file in TextWrangler (or some other text editor that can handle removing line breaks from the file)
  5. Once you are in TextWrangler with the file open, select the Text menu and then Remove Line Breaks.
  6. Now, I like to make sure that the file comes up in the Kindle with the right title and author because "Unknown" is a little difficult to find later on.  To make sure that it will convert nicely go to the top of the file and insert the following two lines of text:
    Title: The Wind in the Willows
    Author: Kenneth Grahame
  7. Now save the file and you can close the text editor.
  8. Open the text file in Stanza (either with the File->Open File... command or by Ctrl-Clicking the text file and selecting Open With->Stanza).
  9. In Stanza, select File->Export Book As->Amazon Kindle
  10. Make sure you note where the .azw file gets saved to.
  11. Plug in the Kindle
  12. When the Kindle has been plugged in to the Mac it will mount as a drive.  This is what you want.  Open the "Kindle" drive in the Finder and select the "documents" folder.
  13. Now copy the .azw file to the documents folder and eject the Kindle.
  14. The next time you power on your Kindle you should have The Wind in the Willows available as a selection to read.


5 comments:

Andrys Basten said...

You are a very patient man. And that was a good general lesson on text-docs to Kindle.

These days, you don't need to do this though.

See the how-to at http://bit.ly/kgutenb which I put together from instructions given by James Adcock. You click to download the "Magic Catalog" for Project Gutenberg books for the Kindle.

Then you search or browse it on your Kindle and when you see something you like, you click on the link and the Kindle downloads it and it is ready to read.

This is very nice !

I hope you like it.

- Andrys

Justin said...

Andrys, thanks for the comment. I will definitely follow your how-to for Project Gutenberg items. I'm just getting all shivery thinking of having all of Project Gutenberg to browse on my Kindle. Wow.

(Just as an aside I was browsing around looking for Kindle'ish things and I happened across a post at your blog where you did a great comparison between the original Kindle and the Kindle 2 displays and I got a good laugh out of your response to the first commenter on that post.)

Andrys Basten said...
This comment has been removed by the author.
Andrys Basten said...

Justin, I had to go look that up and had forgotten about it. I laughed too.

LOVE the photo of you and Elena on your 'profile' ... says so much, and all upbeat.

I've bookmarked your page so I can let people know if they ask about transferring text from book sites like the Christian Classics Ethereal Library.

By the way, am going to Egypt soon and heard a lecture by Professor Bob Brier on it in which he described the theory that Joseph and his brothers were among what were called the Hyksos of the time. To get the full biblical story, I chose the new Int'l version of the bible (on my Kindle -- I have the Standard one on the Kindl also) and was struck once more by how tough the Old Testament God was!

And what a colorful story Joseph's was, beyond being thrown into the pit and his coat taken. Somehow I didn't hear 'the rest of the story' before. But, fascinating.

Take care, and thanks for the guide!

- Andrys

Justin said...

Oh, I'd love to go to Egypt. I hope you have a great trip. I had heard the Hyksos theory. It seems to make sense given what seems to be a rather un-Egyptian way that Joseph is treated (elevating a non-Egyptian in that manner).