Setting a maximum line length
I have an MP4 player which can display e-books but only as text files (.TXT).
I have software to convert files to that format but, unfortunately, the converted files do not wrap properly on the screen. Instead of line breaking where a line is too long for the screen, words continue across the screen edge, so that the first few letters are on one line and the remainder on the next. I want to format the files so that they suit the screen width i.e. line break every 30 characters. I've tried numerous text editors to no avail. Any ideas? |
Re: Setting a maximum line length
Geek Warning!!!!!!
Python can do this easily in scripting. install python from Python 3.2.2 Release create a folder on your C drive called ebooks ( i tested under Linux obviously but Python is Platform agnostic so should be OK) save the following as ebook.py in it altering the text inside the quotes to the name of your ebook text file ( e.g. howtoprograminpython.txt to sausagesaretasty.txt & howtoprograminpython_fixed.txt to sauasgesaretasty_fixed.txt) Code:
def word_wrap(string, width=80, ind1=0, ind2=0, prefix=''): Code:
python ebook.py |
Re: Setting a maximum line length
forgot to say, you need to place the original text files in the ebooks folder you created....
|
Re: Setting a maximum line length
Thanks for the advice.
It's a bit daunting, I'm no programer, but I would have given it a try. However I've managed to find a more idiot proof solution using "Text Mechanic". Add/Remove Line Breaks A little long-winded perhaps, buy I understand much better what I'm doing. Thanks again. |
All times are GMT. The time now is 05:01. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Friendly URLs by vBSEO 3.6.1
© 2003-2013 AccringtonWeb.com