RE Help for text files.
Posted: Tue Sep 17, 2002 1:57 pm
I'm blind; I use MSReader to read ebooks aloud. It works; But, when files have built in garbage (page headers, footers, numbers, garbage characters, I go crazy. So, I need nice clean .txt files that may be converted to .lit format.
I find TextPad very usefull for cleaning up these .txt files. But, I am having trouble in understanding REs (Regular Expression) usage.
For example, In the following text:
"Jill Meyers was a smoothly competent pilot, Kinsman knew from their weeks of training in Texas. But so is Smitty,
and D'Angelo . . . and Colt."
There is a "hardcoded" return "\n" after "Smitty," and before "and D'Angelo"
The double "\n\n" stops the Textpad Reformat command from eliminating them. And, I can find this situation with a RE of the form \n\n[:lower:]
But, I can't figure out how to code the replace string.
Does anyone know how to do this?
Or, does anyone know where I can find a good set of examples for using REs on text files?
I find TextPad very usefull for cleaning up these .txt files. But, I am having trouble in understanding REs (Regular Expression) usage.
For example, In the following text:
"Jill Meyers was a smoothly competent pilot, Kinsman knew from their weeks of training in Texas. But so is Smitty,
and D'Angelo . . . and Colt."
There is a "hardcoded" return "\n" after "Smitty," and before "and D'Angelo"
The double "\n\n" stops the Textpad Reformat command from eliminating them. And, I can find this situation with a RE of the form \n\n[:lower:]
But, I can't figure out how to code the replace string.
Does anyone know how to do this?
Or, does anyone know where I can find a good set of examples for using REs on text files?