Community
    • Login

    Finding end of line with specific character right after

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 2.3k Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Ger PGG Offline
      Ger PG
      last edited by

      Hello,

      I have been searching the internet for a while now and I cannot seem to find a solution for my problem. I am trying to target line breaks that contain a specific character in the new line right after to replace that by something else.

      For example, my text looks like:

      This is an example text
      @ and this is a new line

      And I want it to look like:

      This is an example text and this is a new line.

      So I want to delete line breaks only if the next line begins by “@”.

      The solution must be pretty simple but I am a little noob, so any help would be highly appreciated.

      Thanks in advance!

      1 Reply Last reply Reply Quote 0
      • gstaviG Offline
        gstavi
        last edited by

        Using “find and replace”. Select ‘Extended’.
        Search for \n@ and replace with nothing or space.
        Assuming you use Linux End Of Line. If you use Windows EOL search for \r\n@.

        1 Reply Last reply Reply Quote 0
        • Ger PGG Offline
          Ger PG
          last edited by

          I had tried \r\n @, with an empty space between the “n” and the “@”. Don’t really know why I put the space there.

          Thanks for your help!

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors