Page 1 of 1

how to replace certian steps

Posted: Mon Jan 10, 2005 11:46 pm
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
:)

Posted: Tue Jan 11, 2005 12:03 am
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

Posted: Tue Jan 11, 2005 12:19 am
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

Posted: Tue Jan 11, 2005 12:22 am
by Bob Hansen
Did you put a checkmark in Regular Expression in the Search Window?

Posted: Tue Jan 11, 2005 12:25 am
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?

Posted: Tue Jan 11, 2005 12:33 am
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.

Posted: Tue Jan 11, 2005 12:50 am
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.

Posted: Tue Jan 11, 2005 12:55 am
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

Posted: Tue Jan 11, 2005 1:26 am
by f000ker
another thing will this thing dedupe?

Posted: Tue Jan 11, 2005 1:34 am
by s_reynisson
Hmm, looks like a macro job to me, are you sure about using regex for this?

Posted: Tue Jan 11, 2005 1:38 am
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?

Posted: Tue Jan 11, 2005 1:51 am
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?