Finding end of line with specific character right after



  • 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!



  • 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@.



  • 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!


Log in to reply