3

In NotePad++ how do I turn this:

GingeredRovinsky7|NTDc4MAODY3Mg|

into this:

GingeredRovinsky7=NTDc4MAODY3Mg

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?

0

3 Answers 3

4

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:

\1=\2

4

You can use a regular expression at the replace dialog.

Find:

.{1}$

Replace with nothing Then just select Replace All

Full options are: enter image description here

3

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.

You must log in to answer this question.