Where am I going wrong with this replace please? I want to turn this
Accessibility Controls
access.cpl
Add Hardware Wizard
hdwwiz.cpl
Add/Remove Programs
appwiz.cpl
etc
into this
Accessibility Controls: access.cpl
Add Hardware Wizard: hdwwiz.cpl
Add/Remove Programs: appwiz.cpl
etc
I don't see why this doesn't work:
Find
(.*)\n(.*)\n
Replace with
\1: \2\n
--
Terry, East Grinstead, UK
Seems simple ... but fails
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
You haven't told us it what way it doesn't work.
You haven't told us which version of TextPad you're using.
If you're using version 7, to match the ith captured subexpression you need $i, not \i.
If your pairs of lines are separated by a blank line, as in your example, you need an extra \n.
Try this:
You haven't told us which version of TextPad you're using.
If you're using version 7, to match the ith captured subexpression you need $i, not \i.
If your pairs of lines are separated by a blank line, as in your example, you need an extra \n.
Try this:
Find what: (.*)\n(.*)\n\n
Replace with: $1: $2\n\n
You haven't told us it what way it doesn't work.
It gives this result:
Accessibility Controls: access.cpl
: Add Hardware Wizard
hdwwiz.cpl:
Add/Remove Programs: appwiz.cpl
You haven't told us which version of TextPad you're using.
4.7.2 32 bit
If your pairs of lines are separated by a blank line, as in your example, you need an extra \n.
Thanks, that fixed it!
Find
(.*)\n(.*)\n\n
Replace with
\1: \2\n\n
gave this correct result
Accessibility Controls: access.cpl
Add Hardware Wizard: hdwwiz.cpl
Add/Remove Programs: appwiz.cpl
--
Terry, East Grinstead, UK
It gives this result:
Accessibility Controls: access.cpl
: Add Hardware Wizard
hdwwiz.cpl:
Add/Remove Programs: appwiz.cpl
You haven't told us which version of TextPad you're using.
4.7.2 32 bit
If your pairs of lines are separated by a blank line, as in your example, you need an extra \n.
Thanks, that fixed it!
Find
(.*)\n(.*)\n\n
Replace with
\1: \2\n\n
gave this correct result
Accessibility Controls: access.cpl
Add Hardware Wizard: hdwwiz.cpl
Add/Remove Programs: appwiz.cpl
--
Terry, East Grinstead, UK