Sublime Forum

Deleting digits after a specific character

#1

Hi!!

I have a big block of text in Word that I can import into TextEdit or other simple Text doc . . .

Throughout the document (1500 pages), I have thousands of:

*23
Freud was the first to use “Psychotherapy.”
*24
Freud and Rogers were the key theorists of the 20th Century.
*25
. . . and so on for about 3000 or so.

I want to remove * + the numbers after without disturbing the text that follows on the next line.

Help!! It would take me a week doing this manually.

0 Likes

#2

In Sublime Text:

  1. Find > Replace (Ctrl+H in Windows)
  2. Enable “Regular expression” (Alt+R)
  3. Find What: ^*\d+$
  4. Replace With: [leave blank]
  5. Replace or Replace All

If you want to also remove the line break after the numbers, add a “\n” to the end of the Find What (so: ^*\d+$\n).

But you can also do this directly in Word:

  1. Ribbon > Home > Replace (Ctrl+H in Windows)
  2. Find: ^13*[0-9]@^13
  3. Replace: ^p^p
  4. Enable “Use wildcards”
  5. Replace or Replace All

If you want to also remove the line break after the numbers, remove the second ^p in the Replace field.

Here are some details about Find and Replace in Word:

support.office.com/en-ca/article … b0ad1c427f

0 Likes