M
M
MISPRINT2022-01-17 10:15:49
System administration
MISPRINT, 2022-01-17 10:15:49

How to delete everything in a line after the last space using Notepad++?

There is a list like...

100 million 1284
julian edelman 13459
100 service car 384958

In which there are 6 spaces in one line, you need to delete everything that is exactly after the last space.

Thank you.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dollar, 2022-01-17
@dollar

Removes digits after the last space (and only digits):
Find: ^(.*) \d+$
Replace with:\1

picture
61e51dcc8188c100211313.png

A
Akina, 2022-01-17
@Akina

Find: +[^ ]+$(at the beginning before plus one space)
Replace: (empty line)
Mode - regular expressions, looped search.
Removes everything from the last whitespace to the end of the string if the string ends with a non-whitespace. Deletes the last space itself (if there is more than one, it deletes everything). If the last character in the string is a space, it does not delete anything.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question