ccain 当前离线
列兵
评分人数
wskwfkbdn (见与不见)当前离线
五级士官
TOP
诗歌王位 当前离线
@echo off && setlocal enabledelayedexpansion if exist 2.txt (del /f /q 2.txt) for /f "delims=" %%i in (1.txt) do ( set "var=%%i" for /f tokens^=4^,6^,8delims^=^" %%a in ("!var!") do ( set var=!var:%%a=0! set var=!var:%%b=1! set var=!var:%%c=1! echo !var!>>2.txt ) )复制代码
happy886rr 当前离线
等待验证会员
sed -i "s/exp=\"[0-9]*\"/exp=\"0\"/g";"s/fortune=\"[0-9]*\"/fortune=\"1\"/g";"s/estate=\"[0-9]*\"/estate=\"1\"/g" a.txt复制代码
pcl_test 当前离线
荣誉版主
powershell -c "$(type 'test.xml') -replace 'exp=\"[^^\"]*\"','exp=\"0\"' -replace 'fortune=\"[^^\"]*\"','fortune=\"1\"' -replace 'estate=\"[^^\"]*\"','estate=\"1\"'" pause复制代码
mshta http://bathome.net/s/hta "type('test.xml').replace(/(exp=\"")[^""]*(\"")/g,'$10$2').replace(/(fortune=\"")[^""]*(\"")/g,'$11$2').replace(/(estate=\"")[^""]*(\"")/g,'$11$2')" pause复制代码
CrLf 当前离线
论坛巡查
WHY 当前离线
上校
$Hash = @{exp = '0'; fortune = '1'; estate = '1'}; $str = [IO.File]::ReadAllText('D:\Test\1.txt', [Text.Encoding]::Default); $reg = [regex]'(?i)(exp|fortune|estate)="\d*"'; $reg.Replace($str, {param($m); $m.Groups[1].Value + '="' + $Hash[$m.Groups[1].Value] + '"'})复制代码