View Single Post
Old 10-14-2009, 02:52 AM   #9
savignien
Member
savignien began at the beginning.
 
savignien's Avatar
 
Posts: 19
Karma: 10
Join Date: Jul 2009
Device: cybook gen3
Quote:
Originally Posted by roquet View Post
anyone know a linux program for cleaning up txt files? I tried Mobipocket Creator 4.2 in Wine and it installs ok but can't do anything with it.
Nearly all linux editors support "regular expressions" that are a powerful mean to clean up files. OpenOffice can also do it (there is a "regular expression" checkbox in the Find/Replace window).
The problem is to craft the right regular expression... fortunately the online help of openoffice contains a list of regular expressions that can help you. See also the manual of the grep command for a more complete reference (man grep in a console).

Other editors include vi (available on every linux box, but not graphical), gvim (graphical version of vi), sed (stream editor), and many others...

Examples in vi :
:%g/^$/d
to delete empty lines
:%s/ */ /
to replace one or more space by one space

Hope this helps,
savi.
savignien is offline   Reply With Quote