回复 2# for_flr
感谢大侠帮忙,
在遍历文件修改时, 空行也会加上 ->- cd $HOME\Desktop
- gc -enc UTF8 "PS别名.txt" | foreach{
- $_.split("->", 3)[2] + " -> " + $_.split("->", 3)[0]
- } | Out-File -enc utf8 别名ok.txt
复制代码 原txt:
? -> Where-Object
where -> Where-Object
% -> ForEach-Object
foreach -> ForEach-Object
type -> Get-Content
转后的txt:
Where-Object -> ?
Where-Object -> where
ForEach-Object -> %
ForEach-Object -> foreach
->
Get-Content -> type |