In Notepad++, I want to remove everything up to (before) and including the fifth | character in a line, and keep everything after the fifth | character.

So, the original line would look like:

note,:264058|Feb 14 2009 new document|54012|0411|2016|new document|new medicine|book store|784512|Ontario|Canada|80023569

How would I get output:

new document|new medicine|book store|784512|Ontario|Canada|80023569


  1. open replace dialog in notepad++ (CTRL+H)
  2. for search mode select regular expression
  3. check the box "wrap around"
  4. in "find what" enter (^|\n)([^|]*\|){5}(.*) - see here for explanation
  5. in "replace to" enter \1\3
  6. press "replace all"
  • @Nghia: If it solves your problem please don't forget to accept it. Jul 23 '16 at 13:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.