RE Help for text files.

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
Lee Page

RE Help for text files.

Post by Lee Page »

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?
Jeff Epstein

Re: RE Help for text files.

Post by Jeff Epstein »

First of all, if you select all of the lines you want to reformat, and then right click over the selection, and *then* click reformat, the lines will be joined as you want.

Curious: Is this suggestion possible to implement with your interface? Are you totally blind, or severely impared? Do you use TextPad via a voice interpreter, or just view it with really really big fonts?

For a good starting site for TextPad REs, check out my site:

http://www.jeffyjeffy.com/docs/textpad/ ... n_faq.html


:' )
Jeffy
http://www.jeffyjeffy.com/textpad
Jeff Epstein

Re: RE Help for text files.

Post by Jeff Epstein »

Ed

Re: RE Help for text files.

Post by Ed »

Lee
Jeff's page is very helpful.

I think you meant:
\n\n[[:lower:]]
ie double brackets.
If you change the search string to
\n\n\([[:lower:]]\)
and make the replacement string
\1
(There's supposed to be a leading space on that line) it will do what you want
Post Reply