Search/Replace question regarding Replace part
-
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: uncheckedThe 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.
-
@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
. -
@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. :)