concatenating lines containing certain patterns

General questions about using TextPad

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

Post Reply
coppertop
Posts: 2
Joined: Mon Sep 10, 2012 9:56 pm
Location: Kailua, HI
Contact:

concatenating lines containing certain patterns

Post 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
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post 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
coppertop
Posts: 2
Joined: Mon Sep 10, 2012 9:56 pm
Location: Kailua, HI
Contact:

concatenating lines containing certain patterns

Post by coppertop »

Works perfectly. Thanks Ben
Post Reply