-1

please help..

I have 300k data, that need manage use regex add some symbol. what symbol I need to add is |

First Line Text |
Second Line Text |

the problem now. my data first line and second line is random, no any patern for regex rule. is that possible to do? thanks

Aaron
  • 21,986
  • 2
  • 27
  • 48
hendra
  • 75
  • 6
  • You'd better use a scriptable editor, but the following regex should work fine in notepad++ assuming your pointer is somewhere on the first line : match `([^\r\n]*)(\R)([^\r\n]*)`, replace by `\1|\2\3|` – Aaron Feb 05 '20 at 13:38

1 Answers1

0
  • Ctrl+H
  • Find what: \A.+\K(\R.*$)
  • Replace with: |$1|
  • CHECK Wrap around
  • CHECK Regular expression
  • UNCHECK . matches newline
  • Replace all

Explanation:

\A          # beginning of file
.+          # 1 or more any character but newline
\K          # forget all we have seen until this position
(           # group 1
    \R      # any kind of linebreak (i.e. \r, \n, \r\n)
    .*      # 0 or more any character but newline
    $       # end of line
)           # end group 1

Screen capture (before):

enter image description here

Screen capture (after):

enter image description here

Toto
  • 83,193
  • 59
  • 77
  • 109