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
Find/Replace in marked (bookmarked) lines
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
- Posts: 2461
- Joined: Sun Mar 02, 2003 9:22 pm
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:
This assumes you are using Posix regular expression syntax:
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:
Whether something like this is practicable in your case depends on exactly what you are doing.Find what: ^(Marker.*)OldText
Replace with: \1NewText
[X] Regular expression
This assumes you are using Posix regular expression syntax:
Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
-
- Posts: 14
- Joined: Tue Jul 31, 2007 3:14 pm
Trying to replace test in marked lines. @A first 2 chars in a line. Posix & reg expn selected.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:
Whether something like this is practicable in your case depends on exactly what you are doing.Find what: ^(Marker.*)OldText
Replace with: \1NewText
[X] Regular expression
This assumes you are using Posix regular expression syntax:Configure | Preferences | Editor
[X] Use POSIX regular expression syntax
find- ^(Marker.*)@A tried ^(Marker.*)[@][A] also. Not finding.
replace- \1@D
How to code if @A is anywhere in a line?
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.
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