View Single Post
Old 07-29-2008, 10:25 AM   #5
Junior Member
monojohnny began at the beginning.
Posts: 3
Karma: 10
Join Date: Jul 2008
Device: Kindle
Thanks again for that , make sense.

Posting the final version of program here, in case its of some use to other people.

-- CUT HERE, save as 'convert.rb' --
# Simple Ruby script to convert text-format ebooks from Project Gutenberg
# To a format which is more readable on an Amazon Kindle.
# Run with 'ruby -an convert.rb <original.txt> > <new.txt>'
# links:,

BEGIN { BLANKLINE=sprintf("\r\n"); }

if $_ == BLANKLINE then
printf("\n\t"); next;
printf(" %s",$_);
-- CUT HERE --
monojohnny is offline   Reply With Quote