Ru_Evan 当前离线
列兵
Five66 当前离线
上尉
[regex]::replace((gc -raw 'ABC.txt'),'(?i)\\u([0-9a-f]{4})',{[char][int]("0x"+$args[0].groups[1])})|sc "new_ABC.txt"COPY
TOP
powershell -c "[regex]::replace((gc -raw 'ABC.txt'),'(?i)\\u([0-9a-f]{4})',{[char][int]("0x"+$args[0].groups[1])}) ^| sc "new_ABC.txt""COPY
@echo offpowershell -c "[regex]::replace((gc -raw 'ABC.txt'),'(?i)\\u([0-9a-f]{4})',{[char][int]('0x'+$args[0].groups[1])})|sc 'new_ABC.txt'"echo done&pause&exit /bCOPY
aloha20200628 当前在线
少校
@echo off &powershell "$u2x={param($v)[char][int]($v.value.replace('\u','0x'))};$v=[regex]::replace((gc 'abc.txt' -enc utf8 -raw -readcount 1000),'(?i)\\u[\da-f]{4}',$u2x);[io.file]::writealltext('abc.new.txt',$v)" &pause&exit/bCOPY
Get-Content : 找不到与参数名称“enc”匹配的参数。所在位置 行:1 字符: 156+ ... 817296.txt' -enc utf8 -r ...+ ~~~~ + CategoryInfo : InvalidArgument: (:) [Get-Content],ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommandCOPY
@echo off &powershell "$u2x={param($v)[char][int]($v.value.replace('\u','0x'))};$v=[regex]::replace([io.file]::readalltext('abc.txt'),'(?i)\\u[\da-f]{4}',$u2x);[io.file]::writealltext('abc.new.txt',$v)" &pause&exit/bCOPY
wanghan519 当前离线
三级士官