@echo on
setlocal

cd /d %~dp0

for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ham "High Availability Manager"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ham "External Storage Access Manager"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_vpm "Virtual Partition Manager"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_uvm "Universal Volume Manager"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_nf_compression_mode "Accelerated Compression"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_nf_compression_mode_s "accelerated compression"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ndm "nondisruptive migration"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_enc "Encryption License Key"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_hssc "HPE technical support"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_dpo "Dynamic Provisioning"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_gad "global-active device"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_hrt "Real Time Smart Tier"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_ddm1 "Data Direct Mapping"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_ddm1_s "data direct mapping"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_ddm2 "Data Direct Mapped"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_ddm2_s "data direct mapped"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_nf_compression_mode "Capacity Expansion"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_nf_compression_mode_s "capacity expansion"
@rem 後で修正する for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_sn_sh "Remote Web Console"
@rem 後で修正する for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_sn_sh "Storage Navigator"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_dpo "Thin Provisioning"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_gad "High Availability"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_hssc "customer support"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_uvm "External Storage"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ndm "Online Migration"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_dto "Dynamic Tiering"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_enc "DKA Encryption"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_hrt "active flash"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_hrt_title "Active Flash"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_dto "Smart Tiers"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ti "Thin Image"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ti "Fast Snap"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_hssc "the HSSC"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_smis_acr "SMI-S"
@rem for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" cmn_hssc "HSSC"
@rem 後で修正する for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_dto_acr "HDT"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_gad_acr "GAD"
@rem 後で修正する for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_dp_acr "THP"
@rem 後で修正する for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_dp_acr "DP"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ti_acr "TI"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" title_dto "DT"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_ti_acr "FS"
for /f "delims=" %%i in ('dir /s /b new*.xml') do call :change "%%i" pp_gad_acr "HA"
del /s /q *.bak
goto :EOF


:change

perl -i.bak -pe "s/(A>.*|N>.*)\b%~3\b/$1\@%~2\@/g" %1
@rem perl -i.bak -pe "s/(A>.*|N>.*)%~3/$1\@%~2\@/g" %1


@rem perl -i.bak -pe "s/(.*HIE_JA.*)%~2/$1@pp_sn_sh@/g" %1
@rem perl -i.bak -pe "s/(.*HIE_JA.*)%~2/$1@pp_sn_sh@/g" %1
@rem perl -i.bak -pe "s/(.*HIJ_EN.*)%~2/$1@pp_sn_sh@/g" %1
@rem perl -i.bak -pe "s/(.*HIJ_JA.*)%~2/$1@pp_sn_sh@/g" %1

@rem perl -i.bak -pe "s/(.*HPE_EN.*)\b%~3\b/$1@pp_sn_sh@/g" %1
@rem perl -i.bak -pe "s/(.*HPE_JA.*)\b%~3\b/$1@pp_sn_sh@/g" %1
@rem perl -i.bak -pe "s/(.*HPJ_EN.*)\b%~3\b/$1@pp_sn_sh@/g" %1
@rem perl -i.bak -pe "s/(.*HPJ_JA.*)\b%~3\b/$1@pp_sn_sh@/g" %1

goto :EOF

endlocal

