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"复制代码
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""复制代码
@echo off 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'" echo done&pause&exit /b复制代码
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/b复制代码
Get-Content : 找不到与参数名称“enc”匹配的参数。 所在位置 行:1 字符: 156 + ... 817296.txt' -enc utf8 -r ... + ~~~~ + CategoryInfo : InvalidArgument: (:) [Get-Content],ParameterBindingException + FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.GetContentCommand复制代码
@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/b复制代码
wanghan519 当前离线
三级士官