Delete all characters between cursor and specific text
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
scottatbhm
- Posts: 12
- Joined: Thu Mar 12, 2009 10:08 pm
Delete all characters between cursor and specific text
Hi, and thanks in advance for your help. I'm editing some huge medical records for a hospital and I have to remove variable length strings of characters from the cursor up to a specific text string, and leave the string intact.
If the find string is a fix string (not a regex):
Create a macro that does the following:
1. find, with "Extend Selection" checked. (This selects the text from cursor position to end of find string).
2. Use shift-cursorleft for as many positions as the find string is long (this removes the find string from the selection, you might also go back whole words if appropriate by using ctrl-shift-left).
3. Delete the selection.
Create a macro that does the following:
1. find, with "Extend Selection" checked. (This selects the text from cursor position to end of find string).
2. Use shift-cursorleft for as many positions as the find string is long (this removes the find string from the selection, you might also go back whole words if appropriate by using ctrl-shift-left).
3. Delete the selection.