find and replace

General questions about using TextPad

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

Post Reply
srive99
Posts: 30
Joined: Fri Apr 16, 2010 1:45 pm

find and replace

Post by srive99 »

Hi All,
I have a text like below..

dn: cn=user,ou=some,o=org
something: some/data/some/data

dn:cn=usera,ou=some,o=org
something: other/data/other/data

I want to remove everything after first slash like below..

dn: cn=user,ou=some,o=org
something: some

dn:cn=usera,ou=some,o=org
something: other

How I can use regular expression to do this in the textpad?

Thanks
ben_josephs
Posts: 2459
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Search | Replace... (<F8>):
Find what: /.*
Replace with: [nothing]

[X] Regular expression

Replace All
srive99
Posts: 30
Joined: Fri Apr 16, 2010 1:45 pm

Post by srive99 »

Thanks for your quick reply but it did not work for me..
I tried as below
find - /.*
replace - nothing

I made sure regular expression check box selected.

Thanks again..

ben_josephs wrote:Search | Replace... (<F8>):
Find what: /.*
Replace with: [nothing]

[X] Regular expression

Replace All
srive99
Posts: 30
Joined: Fri Apr 16, 2010 1:45 pm

Post by srive99 »

I think that may be issue with back slash

Sorry i mistype the data I had
I have a data like below.
dn: cn=usera,ou=some,o=org
some: some\data\someother\data

dn: userb,ou=some,o=org
some: other\data\some\data

and I need like below...
dn: cn=usera,ou=some,o=org
some: some

dn: userb,ou=some,o=org
some: other

Thanks again


srive99 wrote:Thanks for your quick reply but it did not work for me..
I tried as below
find - /.*
replace - nothing

I made sure regular expression check box selected.

Thanks again..

ben_josephs wrote:Search | Replace... (<F8>):
Find what: /.*
Replace with: [nothing]

[X] Regular expression

Replace All
ben_josephs
Posts: 2459
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Find what: \\.*
Replace with: [nothing]
Post Reply