Page 1 of 1

Find/Replace in marked (bookmarked) lines

Posted: Fri Jun 09, 2006 1:05 pm
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

Posted: Fri Jun 09, 2006 3:34 pm
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

Posted: Thu Aug 31, 2006 4:25 pm
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)

Posted: Sat Aug 18, 2007 12:17 pm
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?

Posted: Sat Aug 18, 2007 1:59 pm
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.