Reg Expressions Help (I read the FAQ)

General questions about using TextPad

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

Post Reply
Don

Reg Expressions Help (I read the FAQ)

Post by Don »

Maybe I've been living in the PC world too long but this regular expression stuff has got me stumped. I've 12,000+ lines of text and I need to do some powerful editing, hence regular expressions came in. If you can help please do.

What I've got:

If DigOut_5_Transport4_Value6 <> Log_DigOut_5_Transport4_Value6 then
Call RoutineX(DigOut_5_Transport4_Value6 ,Log_DigOut_5_Transport4_Value6 ,DigOut_5_Tran sport4_Value6.comment, DigOut_5_Transport4_Value6.EngUnits)
else
Log_DigOut_5_Transport4_Value6=DigOut_5_Transport4_Value6
endif

What to Find

DigOut .EngUnits (where the spaces can be any number of stuff)

Replace the whole thing beginning with DigOut and ending with .EngUnits
with " " (double Quotes)

After Replacing:

If DigOut_5_Transport4_Value6 <> Log_DigOut_5_Transport4_Value6 then
Call RoutineX(DigOut_5_Transport4_Value6 ,Log_DigOut_5_Transport4_Value6 ,DigOut_5_Tran sport4_Value6.comment, " ")
else
Log_DigOut_5_Transport4_Value6=DigOut_5_Transport4_Value6
endif

Any Ideas?
Andreas

Re: Reg Expressions Help (I read the FAQ)

Post by Andreas »

Replace
Digout[0-9a-zA-Z_]+.EngUnits
by
" "

or
DigOut_[0-9]_Transport[0-9]_Value[0-9].EngUnits
by
" "

Whatever fits your needs better - I do not know enough of the problem to decide..
Roy Beatty

Re: Reg Expressions Help (I read the FAQ)

Post by Roy Beatty »

Consider putting a backslash (\) before the periods in your find strings.
That will make them literal values to match against. I'm sure it would make no practical difference in this case.
don

Re: Reg Expressions Help (I read the FAQ)

Post by don »

Thanks for the help, worked like a charm. Looking at your solutions my error was in how I chose to seperate text from commands.
ron

Re: adding numbers to a group

Post by ron »

I am trying to set-up a contact list with a group of phone numbers. I have a list of approx. 10,000 numbers without area codes in an Excel spreadsheet. How can I use Textpad to place a three digit area codes in front of each of these numbers?
Thank you,
Ron
Adam Glauser

Re: adding numbers to a group

Post by Adam Glauser »

Ron,

Perhaps:
Replace
[0-9]\{3\}-[0-9]\{4\}

with
(place area code here) $

An example of a replacement string would be:
(519) $
Post Reply