Community
    • Login

    Find a Carriage Return only and delete. Whilst Ignoring all Carriage Return Line Feeds within the file

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 626 Views
    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.
    • MaxM Offline
      Max
      last edited by Max

      Hi

      I’ve a rather large file with most of the data within having CRLF at the end of the row.

      I would like to find the lines of data with just a CR and delete them to shift my data onto the correct line.

      I’ve got this Find/Replace regular expression off another topic on this forum that works the other way around but manipulating it seems to find CRLF when I want to find CR only and delete

      ^(.*?|^\r)\n

      Any help would be appreciated.
      Thank you
      Max

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA Offline
        Alan Kilborn @Max
        last edited by

        @Max

        In Regular expression Search mode, search for:

        \r(?!\n)

        and replace with nothing.

        1 Reply Last reply Reply Quote 3
        • MaxM Offline
          Max
          last edited by

          Marvellous. Thank you!

          1 Reply Last reply Reply Quote 2

          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