add hyphen between lines

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

add hyphen between lines

Post by srive99 »

Hello,

I have a following data ..
dn: cn=some,ou=orgperson,o=org
changetype: modify
add: attribute
attribute: somevalue
attribute: someother
attribute: somethinglese

dn: cn=some,ou=orgperson,o=org
changetype: modify
add: attribute
attribute: somevalue
attribute: someother
Now I want to add hyphen (-) in between attributes... It should be below.
dn: cn=some,ou=orgperson,o=org
changetype: modify
add: attribute
attribute: somevalue
-
attribute: someother
-
attribute: somethinglese

dn: cn=some,ou=orgperson,o=org
changetype: modify
add: attribute
attribute: somevalue
-
attribute: someother
How can we achieve this with regular expressions.

Thanks a bunch
User avatar
kengrubb
Posts: 324
Joined: Thu Dec 11, 2003 5:23 pm
Location: Olympia, WA, USA

Post by kengrubb »

This Regex Replace All works, but I have to repeat it to make it work.

Code: Select all

Find what: ^(attribute.*)\n([^-])
Replace with: \1\n-\n\2
(2[Bb]|[^2].|.[^Bb])

That is the question.
Post Reply