Thread: text reformat
View Single Post
Old 08-31-2008, 06:35 PM   #2
DMcCunney
New York Editor
DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.DMcCunney ought to be getting tired of karma fortunes by now.
 
DMcCunney's Avatar
 
Posts: 5,113
Karma: 6192855
Join Date: Aug 2007
Device: Palm TX, Azpen A727 tablet, Fujitsu Lifebook p2110 w/ FBReader
Quote:
Originally Posted by ShacharWeis View Post
Hi everyone,
I have a PRS-505 that I use to read text files from different sources.
The problem is, sometimes the text is already formatted to a certain
line width and when converting it to the PRS (using callibre) it comes out
all messy, with line breaks everywhere.
Is there some tool that can reformat text ?
Maybe remove line breaks gracyfully ? (while retaining the 'right' breaks, for instance when " " are used)

thanks,
Shachar.
What computer and OS are you using? What I think is happening is a problem with line endings in text files.

On Unix/Linux/BSD systems, each line of the text file is terminated by the Linefeed character - ASCII 11

On Older Macs, each line of a text file is terminated by a Carriage Return - ASCII 13.

On DOS/Windows PC, lines in a text file are delimited by both, in a CRLF combination.

Many other applications will treat the CR part of CRLF as a "hard" break character, resulting in what you see on your Sony Reader.

On a Unix/Linux system, I'd use unix2dos and dos2unix to do the transformation, adding or stripping the CRs respectively.

If you are on a PC, and are comfortable working at the command line, you might look here: http://www.bastet.com/

Grab UDDU.zip, which are Windows console versions of unix2dos and dos2nix.

If you want an on line solution, you can try here: http://www.iconv.com/dos2unix.htm

You upload the file you want converted, and it returns a converted version you can save under a different name.

If you prefer the GUI, there are an assortment of text editors that will let you select the line endings you prefer. One I've been fond of for may years is PFE: http://www.lancs.ac.uk/people/steveb...fe/default.htm

PFE is a freeware multi-file text editor with an MDI interface, written by Anthony Phillips at Lancaster University in England.
______
Dennis
DMcCunney is offline   Reply With Quote