Page 1 of 1

concatenating lines containing certain patterns

Posted: Mon Sep 10, 2012 10:05 pm
by coppertop
Hi,
I'm trying to join only lines containing a "-" with the next line

eg.
test-activesyncconnectivity
ServerIdParameter
_[098876677]
get-activesyncdeviceaccessrule
ActiveSyncDeviceAccessRuleIdParameter
_[982e87]

would yield
test-activesyncconnectivity ServerIdParameter
_[098876677]
get-activesyncdeviceaccessrule ActiveSyncDeviceAccessRuleIdParameter
_[982e87]

Thanks in advance

Posted: Mon Sep 10, 2012 10:21 pm
by ben_josephs
Use "Posix" regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Search | Replace... (<F8>):
Find what: ^(.*-.*)\n
Replace with: \1_ [Replace the underscore with a space]

[X] Regular expression

Replace All

concatenating lines containing certain patterns

Posted: Tue Sep 11, 2012 12:26 am
by coppertop
Works perfectly. Thanks Ben