Find/Replace in marked (bookmarked) lines

Ideas for new features

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

Post Reply
kreynold
Posts: 3
Joined: Tue Jan 31, 2006 5:07 pm

Find/Replace in marked (bookmarked) lines

Post by kreynold »

Find/Replace in marked (bookmarked) lines

I think this would be a nice feature to add.

Say you have marked a bunch of lines.
Then you want to replace some secondary set of text
This is not so easy without this feature

Thanks
Keith
ben_josephs
Posts: 2457
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

Yes, that would be nice.

But there may be an alternative solution. How did you mark the lines in the first place? If you used Find | Mark All then you might be able to do it in one go. For example, if you want to replace OldStuff with NewStuff in all lines beginning with Marker, you might use this:
Find what: ^(Marker.*)OldText
Replace with: \1NewText

[X] Regular expression
Whether something like this is practicable in your case depends on exactly what you are doing.

This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
User avatar
srichter1
Posts: 4
Joined: Wed Nov 23, 2005 8:48 pm
Location: Austin, Texas

Post by srichter1 »

I'd like to add my enthusiastic vote for this as a really, really useful feature I'd like to see. Hmm, I guess I should go see if there's a post about this in the "Enhancement Suggestions"...

Susan (wanting to replace " *" with \t only on bookmarked lines)
nathanv117
Posts: 14
Joined: Tue Jul 31, 2007 3:14 pm

Post by nathanv117 »

ben_josephs wrote:Yes, that would be nice.

But there may be an alternative solution. How did you mark the lines in the first place? If you used Find | Mark All then you might be able to do it in one go. For example, if you want to replace OldStuff with NewStuff in all lines beginning with Marker, you might use this:
Find what: ^(Marker.*)OldText
Replace with: \1NewText

[X] Regular expression
Whether something like this is practicable in your case depends on exactly what you are doing.

This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor

[X] Use POSIX regular expression syntax
Trying to replace test in marked lines. @A first 2 chars in a line. Posix & reg expn selected.
find- ^(Marker.*)@A tried ^(Marker.*)[@][A] also. Not finding.
replace- \1@D

How to code if @A is anywhere in a line?
helios
Posts: 716
Joined: Sun Mar 02, 2003 5:52 pm
Location: Helios Software Solutions
Contact:

Post by helios »

You could create a macro as follows:

1. Position the cursor at the beginning of the document.
2. Turn on the Macro recorder.
3. Press F2.
4. Open the Replace diaolog box and type in the required find and replace strings.
5. Press Find Next.
6. Press Replace.
7. Turn off the Macro recorder.
8. Save the Macro.
9. Check the option to Repeat to end of file.

Press the Undo icon to return the document to its former state. Position the cursor at the beginning of the document and run the macro from the macros menu.
Helios Software Solutions
Post Reply