Given test.txt containing:
test message
I want to end up with:
testing a message
I think the following should work, but it doesn’t:
Get-Content test.txt |% {$_-replace 't`r`n', 'ting`r`na '}
How can I do a find and replace where what I’m finding contains CRLF?
A CRLF is two characters, of course, the CR and the LF. However,
`nconsists of both. For example:I think you’re running into problems with the
`r. I was able to remove the`rfrom your example, use only`n, and it worked. Of course, I don’t know exactly how you generated the original string so I don’t know what’s in there.