Delete all characters between cursor and specific text

General questions about using TextPad

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

Post Reply
scottatbhm
Posts: 12
Joined: Thu Mar 12, 2009 10:08 pm

Delete all characters between cursor and specific text

Post by scottatbhm »

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.
User avatar
MudGuard
Posts: 1295
Joined: Sun Mar 02, 2003 10:15 pm
Location: Munich, Germany
Contact:

Post by MudGuard »

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.
scottatbhm
Posts: 12
Joined: Thu Mar 12, 2009 10:08 pm

Post by scottatbhm »

Thanks Mudguard, that worked quite well.
Post Reply