user964946
user964946

Reputation: 69

In Notepad++, removing beginning text from each line?

I have some junk before each line and the text I want

eernnawer love.pdf 
nawewera man.pdf
awettt sup.pdf

I would like to do a find and replace to get

love.pdf
man.pdf
sup.pdf

How can I do this? Thanks

Upvotes: 0

Views: 10023

Answers (4)

kapex
kapex

Reputation: 29959

  1. Ctrl+H to open the search and replace dialog
  2. Activate Regular Expressions as search mode, check Wrap around
  3. Find: .* (.*\.pdf)$
  4. Replace: \1
  5. Click Replace All

\1 is the text found by the expression in the (first) pair of parentheses. If you would want to remove the trailing text, you could use (.*) .*\.pdf$.

Upvotes: 6

manojlds
manojlds

Reputation: 301157

In Find and Replace in regular expression mode, find for .* (note, with a space in the end ) and replace with blank.

Upvotes: 0

Daniel Haley
Daniel Haley

Reputation: 52858

You could find ^[^ ]* and replace it with nothing (notice the space at the end of the regex).

Upvotes: 1

MrTippet
MrTippet

Reputation: 306

You can do ctrl+R click the box for allowing RegEx Insert ^[^\s]+\s into the top box Then Find Then Replace Rest

Upvotes: 1

Related Questions