上万个文件内容如下,,,只有这个DeviceID 里面的不一样,要根据这个ID去命名文件名...
<Keybox DeviceID="860003041204069"><Key algorithm="ecdsa"><PrivateKey format="pem">
-----BEGIN EC PRIVATE KEY-----
MHcCAQEEIKWzfcf+C1aO144cpVJkyVO+TKiHyq42ORRCRqBghboFoAoGCCqGSM49
AwEHoUQDQgAE+zPIMioyMxLXeQsGDiv2L2ra2GXthu1JOU8Bq75YpVXxanVj12Sw
VwrGkr5OC5zrd0wytk/MuIFDb/FLXjceAA==
-----END EC PRIVATE KEY-----
</PrivateKey><CertificateChain><NumberOfCertificates>3</NumberOfCertificates><Certificate format="pem">
-----BEGIN CERTIFICATE-----
MIICIzCCAamgAwIBAgIKAIdgFHO
上代码,保存下面的代码为.bat就可
@echo off
setlocal enabledelayedexpansion
for %%a in (*.txt) do (
set /p Str=<"%%~a"
SET Str2 =!Str:~18,15!
echo 截取后内容:!Str:~18,15!!
echo 文件: %%~nxa 原始内容: !Str! 截取后内容: !Str:~18,15!
ren "%%~nxa" "!Str:~18,15!.txt"
)
pause