有没有办法让 PowerShell 找到并用回车和换行符(\r\nE )替换字符串(例如~}}|{{E)?
例如:
$filenames = @("E:\blergfest.csv")
foreach ($file in $filenames) {
$outfile = "$file" + ".out"
Get-Content $file | Foreach-object {
$_ -replace '\~}}|{{E', '\r\nE' `
-replace '\|\r\n', '\r\n'
} | Set-Content $outfile
}