Page 1 of 1
find and replace
Posted: Tue Apr 26, 2011 7:49 pm
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
Posted: Tue Apr 26, 2011 7:55 pm
by ben_josephs
Search | Replace... (
<F8>):
Find what: /.*
Replace with: [nothing]
[X] Regular expression
Replace All
Posted: Tue Apr 26, 2011 8:24 pm
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
Posted: Tue Apr 26, 2011 9:10 pm
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
Posted: Tue Apr 26, 2011 9:15 pm
by ben_josephs
Find what: \\.*
Replace with: [nothing]