Community
    • Login

    Search/Replace question regarding Replace part

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 119 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.
    • Lycan ThropeL
      Lycan Thrope
      last edited by Lycan Thrope

      Hey folks,

      I’m having a little problem trying to figure out the reason that a search text I’m looking for, upon replacement, is getting a space inserted after the CRLF.

      Searched text:

      DEFINE FORM ACCT_REC ; 
      

      Desired replaced text:

      *Define Open
      DEFINE FORM ACCT_REC ; 
      

      With these S/R strings:
      S:^(Define.*\h)$
      R:*Define Open\r \1
      Regular Expression: checked
      Newline matches: unchecked

      The current results is getting a space put in at the start of the second line like this:

      *Define Open
       DEFINE FORM ACCT_REC ; 
      

      I have tried putting the ^ in the replace text to try and force it to the left margin with no success, and I’m sure if I keep plugging away, I’ll probably stumble into the answer, but I thought I’d pick someone elses brain today as mine seems to be coming down with a cold or something after Jury Duty yesterday from someone sitting next to me and my head is a little dysfunctional today. :-)

      Thanks in advance for any direction to educate my brain today.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Lycan Thrope
        last edited by

        @Lycan-Thrope said in Search/Replace question regarding Replace part:

        \r

        First, don’t do that, if you have Windows formatted files (the usual case).
        You want to use \r\n.

        Lycan ThropeL 1 Reply Last reply Reply Quote 3
        • Lycan ThropeL
          Lycan Thrope @Alan Kilborn
          last edited by Lycan Thrope

          @Alan-Kilborn ,
          Thanks, I did try that already, but the result is the same. It still puts that space in at the start of the line. :-(

          Edit: But thanks for the input and I did find the problem after looking at it again…It’s my fault. I added a space in the Replace line. DOH!! I also added the \n, as well so thanks.

          Told you my head wasn’t working right today. :)

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