I have a log file with embedded ^ M. I would like to replace ^ M with one space.
I tried options on this:
(Get-Content C:\temp\send.log) | Foreach-Object {$_ -replace "^M", ' '} | Set-Content C:\temp\send.out
The output file contains a new line, where each ^ M was, not at all what I was looking for ...
The problem I'm trying to solve includes studying the last lines of the $ cnt file:
$new = Get-Content $fn | Select-Object -Last $cnt;
$new
When I display $ new, ^ M is interpreted as CR / LF.
How can I remove / replace ^ M? Thanks for any pointers ....
source
share