0

I have a text log file in the following format.

****************************************************************************************
line1
line2
line3
****************************************************************************************
line4
line5
line6
****************************************************************************************

Is there a way in Notepad++ to combine lines between the "*" separators so the data looks like below

****************************************************************************************
line1 line2 line3
****************************************************************************************
line4 line5 line6
****************************************************************************************

Thanks!

1
  • Somehow I doubt it qualifies as programming question... But you definitely can as k how to write a program to do that using some programming language.
    – Eugene Sh.
    Commented Mar 3, 2023 at 19:33

1 Answer 1

1
  • Ctrl+H
  • Find what: (?<!\*)\R(?!\*)
  • Replace with: # a space
  • SELECT Regular expression
  • Replace all

Explanation:

(?<!\*)         # negative lookbehind, make sure we haven't a * before
\R              # any kind of linebreak
(?!\*)          # negative lookahead, make sure we haven't * after

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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