To convert the text file to unix-style line breaks, install the tofrodos package, then open a terminal and type:
Code:
dos2unix Lewis[TAB]
(Replace [TAB] with the tab key. The terminal will autocomplete the name of the file).
To "tighten up" the lines while preserving paragraphs:
Save this to ~/bin/guten_format.py
PHP Code:
#!/usr/bin/env python
import sys
for line in open(sys.argv[1]):
if line.strip()=='':
print('\n')
else:
print(line.rstrip()),
Make it executable:
Code:
chmod 755 ~/bin/guten_format.py
Run it like this:
Code:
in=(Lewis[TAB])
guten_format.py "$in" > out
mv out "$in"
Bookmarks