Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In NotePad++ how do I turn this:


into this:


I know I can do a find and replace and replace the first | with =

However I need to strip the last | from each line as well.

How do I do this?

share|improve this question

migrated from Aug 15 '11 at 4:25

This question came from our site for professional and enthusiast programmers.

up vote 4 down vote accepted

If every line is going to consist of exactly two | characters in that format, I should think this regex find-and-replace will do it.

Find all:


Replace all with:


share|improve this answer

Notepad++ supports extended and regular expression search and replace. Using the extended search and replace you could do this in two passes.

In the first pass replace the trailing | by searching for |\r and replacing with \r:

enter image description here

In the second pass we replace the middle | by doing a normal search and replace.

This of course assumes that your line ends are \r\n.

share|improve this answer

You can use a regular expression at the replace dialog.



Replace with nothing Then just select Replace All

Full options are: enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.