【发布时间】:2013-02-23 09:40:56
【问题描述】:
有没有办法让 PowerShell 找到并用回车和换行符替换字符串(例如 ~}}|{{E)(\r\nE强>)?
例如:
$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
}
【问题讨论】:
标签: powershell control-characters