how to replace certian steps

General questions about using TextPad

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

Post Reply
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

how to replace certian steps

Post by f000ker »

I am wanting to make up a list for example below.
12.221.195.34:38884
130.13.121.110:29992
130.13.151.154:18844
I load a list like this into text pad I want to be able to remove everything past the second . for example I would have left

12.221.
130.13.
130.13.
? any one thanks
also how do you ad numbers to the end of things for example
bluh.1
bluh.2
bluh.3

thanks again
:)
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

find ^([0-9]*\.[0-9]*\.).*$
replace \1

find (bluh)
replace \1.\i

I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box.
HTH
Then I open up and see
the person fumbling here is me
a different way to be
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

Hey thanks for the fast responce i went to replace and pasted in
^([0-9]*\.[0-9]*\.).*$
and it says cant find reg expression
s_reynisson wrote:find ^([0-9]*\.[0-9]*\.).*$
replace \1

find (bluh)
replace \1.\i

I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box.
HTH
User avatar
Bob Hansen
Posts: 1516
Joined: Sun Mar 02, 2003 8:15 pm
Location: Salem, NH
Contact:

Post by Bob Hansen »

Did you put a checkmark in Regular Expression in the Search Window?
Hope this was helpful.............good luck,
Bob
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

Yes i tried it with and with out that checked.
i hightlight text pad hit f8 then paste ^([0-9]*\.[0-9]*\.).*$ into the top box then \1 in the bottom and hit replace all and it says cant find reg expression I tried this with it checked and unchecked right now i have it checked and also text and match checked then onthe other side i have active doc checked
thanks again for yalls time hoping i can firgure this out i know someone said they where using this for this but i cant get it and he is gone for a week.
Bob Hansen wrote:Did you put a checkmark in Regular Expression in the Search Window?
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Pls check "POSIX" under Configure->Preferences->Editor.
I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box.
Then I open up and see
the person fumbling here is me
a different way to be
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

yeap that did the removal part quick thanks man
s_reynisson wrote:Pls check "POSIX" under Configure->Preferences->Editor.
I have used POSIX regular expression syntax, which can be selected from the Editor page of the Preferences dialog box.
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

ok last step is kicking me now I might not of been clear up top with the bluh example lets use same example up top

i did the first step and ended up with this
12.221.
130.13.
130.13.

now how do i make it do this
12.221.0.0
12.221.0.1
12.221.0.2
and so on until it hits 12.221.255.255 and then do the same to the next number in the this
130.13.
130.13. 0.1
etc
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

another thing will this thing dedupe?
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

Hmm, looks like a macro job to me, are you sure about using regex for this?
Then I open up and see
the person fumbling here is me
a different way to be
f000ker
Posts: 16
Joined: Mon Jan 10, 2005 11:43 pm

Post by f000ker »

what is regex?
Sorry but i am brand new to this trying to see what it does before buyingit.
s_reynisson wrote:Hmm, looks like a macro job to me, are you sure about using regex for this?
User avatar
s_reynisson
Posts: 939
Joined: Tue May 06, 2003 1:59 pm

Post by s_reynisson »

I think you're going to have to record a macro for this and then use a regular expression with the \i option. I'll take a look and see what I can come up with. Don't hold your breath, I'm rusty in the macro department! ;)

Edit, OK, I can get a the macro repeating 256 lines for each line. The next macro selects 256 lines and runs a replace incrementing with the \i option for 0-255. It continues to the end of file. Repeat. I'm using the regular expression find ^(.*)\. replace \1.\i(0) and ticking Selected text, a bit simple but if the all the lines end with a dot it works fine. When runnding the second macro for the second time you will have to add a dot to end of each line first. Hope this helps.
I could of course send you the macros if you'd rather like that?
Then I open up and see
the person fumbling here is me
a different way to be
Post Reply