• Login
Community
  • Login

[BUG] find & replace with \n

Scheduled Pinned Locked Moved General Discussion
4 Posts 2 Posters 240 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.
  • L
    Luca L 0
    last edited by Luca L 0 Sep 1, 2020, 6:35 PM Sep 1, 2020, 6:34 PM

    Trying to find & replace (extended search)
    \n;;;;;;;;x;
    with
    ;;;;;;;;x;

    on a text like:
    IS_ROOT;Is ROOT;;;;;È ORIG
    ;;;;;;;;x;
    IS_PREV;Is PREV;;;;;È PREC
    ;;;;;;;;x;
    IS_FROM;Is FROM;;;;;È DI
    ;;;;;;;;x;

    won’t delete the Carriage Return moving back the “;;;;;;;;x;”.
    Expected result:
    IS_ROOT;Is ROOT;;;;;È ORIG;;;;;;;;x;
    IS_PREV;Is PREV;;;;;È PREC;;;;;;;;x;
    IS_FROM;Is FROM;;;;;È DI;;;;;;;;x;

    A 1 Reply Last reply Sep 1, 2020, 6:39 PM Reply Quote 0
    • A
      Alan Kilborn @Luca L 0
      last edited by Alan Kilborn Sep 1, 2020, 6:41 PM Sep 1, 2020, 6:39 PM

      @Luca-L-0

      Works for me to produce your expected result.

      On presumes with your usage of \n that your files are of Unix type?
      Check your status bar for Unix (LF) to be sure.

      If they are of Windows type you end up with this:

      a3bd85a2-67f4-4e88-86fe-e6a238460631-image.png

      Which I’m sure isn’t what you want.

      1 Reply Last reply Reply Quote 3
      • A
        Alan Kilborn
        last edited by Alan Kilborn Sep 1, 2020, 6:45 PM Sep 1, 2020, 6:44 PM

        @Luca-L-0 said in [BUG] find & replace with \n:

        \n;;;;;;;;x;

        Ran out of editing time.

        You may want your Find expression to be \r\n;;;;;;;;x; if you have Windows files.

        You may also want to read up on “line endings” if you aren’t well-versed.

        EDIT: Earlier I said “On presumes” when I should have said “One presumes”

        1 Reply Last reply Reply Quote 3
        • L
          Luca L 0
          last edited by Sep 1, 2020, 6:44 PM

          Correct! Thank you.
          Indeed was a Win file (CR+LF) and works fine searching & replacing:
          \r\n;;;;;;;;x;
          to
          ;;;;;;;;x;

          1 Reply Last reply Reply Quote 3
          2 out of 4
          • First post
            2/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors