@echo off
echo *************************************************************
echo *      F1 PDF ドキュメントファイル名 可読性向上処理
echo *************************************************************
echo 可読性向上のためにフォルダ内のファイル名をリネームします。
echo 元には戻せませんのでご注意下さい。
echo. 
pause
echo. 
echo 準備はできましたか？
pause

setlocal enabledelayedexpansion
set folder=%~dp0

:: ----------------------------------------------------------------
::                             置換処理 
:: ----------------------------------------------------------------
:: 必要に応じて置換文字列を変更してください
for %%F in ("%folder%\*.pdf") do (
    set "filename=%%~nxF"
    set "modifiedFilename=!filename:_brn_=_Brn_!"

    set "modifiedFilename=!modifiedfilename:_ksa_=_KSA_!"
    set "modifiedFilename=!modifiedfilename:_aus_=_AUS_!"
    set "modifiedFilename=!modifiedfilename:_aze_=_AZE_!"
    set "modifiedFilename=!modifiedfilename:_ita_=_ITA_!"
    set "modifiedFilename=!modifiedfilename:_usa_=_USA_!"
    set "modifiedFilename=!modifiedfilename:_esp_=_ESP_!"
    set "modifiedFilename=!modifiedfilename:_mon_=_MON_!"
    set "modifiedFilename=!modifiedfilename:_can_=_CAN_!"
    set "modifiedFilename=!modifiedfilename:_gbr_=_GBR_!"
    set "modifiedFilename=!modifiedfilename:_aut_=_AUT_!"
    set "modifiedFilename=!modifiedfilename:_fra_=_FRA_!"
    set "modifiedFilename=!modifiedfilename:_hun_=_HUN_!"
    set "modifiedFilename=!modifiedfilename:_bel_=_BEL_!"
    set "modifiedFilename=!modifiedfilename:_ned_=_NED_!"
    set "modifiedFilename=!modifiedfilename:_ita_=_ITA_!"
    set "modifiedFilename=!modifiedfilename:_sgp_=_SGP_!"
    set "modifiedFilename=!modifiedfilename:_jpn_=_JPN_!"
    set "modifiedFilename=!modifiedfilename:_mex_=_MEX_!"
    set "modifiedFilename=!modifiedfilename:_bra_=_BRA_!"
    set "modifiedFilename=!modifiedfilename:_uae_=_UAE_!"
    set "modifiedFilename=!modifiedfilename:_bel_=_BEL_!"
    set "modifiedFilename=!modifiedfilename:_tur_=_TUR_!"
    set "modifiedFilename=!modifiedfilename:_rus_=_RUS_!"
    set "modifiedFilename=!modifiedfilename:_qat_=_QAT_!"
    set "modifiedFilename=!modifiedfilename:_ger_=_GER_!"
    set "modifiedFilename=!modifiedfilename:_por_=_POR_!"
    set "modifiedFilename=!modifiedfilename:_chn_=_CHN_!"
    set "modifiedFilename=!modifiedfilename:_bri_=_BRI_!"
    set "modifiedFilename=!modifiedfilename:_mag_=_MAG_!"
    set "modifiedFilename=!modifiedfilename:_chi_=_CHI_!"
    set "modifiedFilename=!modifiedfilename:_sin_=_SIN_!"
    set "modifiedFilename=!modifiedfilename:_mas_=_MAS_!"
    set "modifiedFilename=!modifiedfilename:_bra_=_BRA_!"
    set "modifiedFilename=!modifiedfilename:_bel_=_BEL_!"
    set "modifiedFilename=!modifiedfilename:_bah_=_BAH_!"
    set "modifiedFilename=!modifiedfilename:_bra_=_BRA_!"
    set "modifiedFilename=!modifiedfilename:_jap_=_JAP_!"
    set "modifiedFilename=!modifiedfilename:_abu_=_ABU_!"
    set "modifiedFilename=!modifiedfilename:_ger_=_GER_!"
    set "modifiedFilename=!modifiedfilename:_ind_=_IND_!"
    set "modifiedFilename=!modifiedfilename:_kor_=_KOR_!"
    set "modifiedFilename=!modifiedfilename:_mal_=_MAL_!"
    set "modifiedFilename=!modifiedfilename:_spn_=_SPN_!"

    set "modifiedFilename=!modifiedfilename:_bahrain_=_Bahrain_!"
    set "modifiedFilename=!modifiedfilename:_saudi-arabian_=_Saudi-Arabian_!"
    set "modifiedFilename=!modifiedfilename:_australian_=_Australian_!"
    set "modifiedFilename=!modifiedfilename:_azerbaijan_=_Azerbaijan_!"
    set "modifiedFilename=!modifiedfilename:_miami_=_Miami_!"
    set "modifiedFilename=!modifiedfilename:_emilia-romagna_=_Emilia-Romagna_!"
    set "modifiedFilename=!modifiedfilename:_monaco_=_Monaco_!"
    set "modifiedFilename=!modifiedfilename:_spanish_=_Spanish_!"
    set "modifiedFilename=!modifiedfilename:_canadian_=_Canadian_!"
    set "modifiedFilename=!modifiedfilename:_austrian_=_Austrian_!"
    set "modifiedFilename=!modifiedfilename:_british_=_British_!"
    set "modifiedFilename=!modifiedfilename:_hungarian_=_Hungarian_!"
    set "modifiedFilename=!modifiedfilename:_belgian_=_Belgian_!"
    set "modifiedFilename=!modifiedfilename:_france_=_France_!"
    set "modifiedFilename=!modifiedfilename:_budapest_=_Budapest_!"
    set "modifiedFilename=!modifiedfilename:_heineken_=_Heineken_!"
    set "modifiedFilename=!modifiedfilename:_dutch_=_Dutch_!"
    set "modifiedFilename=!modifiedfilename:_italian_=_Italian_!"
    set "modifiedFilename=!modifiedfilename:_singapore_=_Singapore_!"
    set "modifiedFilename=!modifiedfilename:_austin_=_Austin_!"
    set "modifiedFilename=!modifiedfilename:_mexico_=_Mexico_!"
    set "modifiedFilename=!modifiedfilename:_abu-dhabi_=_Abu-Dhabi_!"
    set "modifiedFilename=!modifiedfilename:_dhabi_=_Dhabi_!"
    set "modifiedFilename=!modifiedfilename:_abu_=_Abu_!"
    set "modifiedFilename=!modifiedfilename:_japanese_=_Japanese_!"
    set "modifiedFilename=!modifiedfilename:_mexican_=_Mexican_!"
    set "modifiedFilename=!modifiedfilename:_brazilian_=_Brazilian_!"
    set "modifiedFilename=!modifiedfilename:_las-vegas_=_Las-Vegas_!"
    set "modifiedFilename=!modifiedfilename:_las_=_Las_!"
    set "modifiedFilename=!modifiedfilename:_vegas_=_Vegas_!"
    set "modifiedFilename=!modifiedfilename:__=__!"

    set "modifiedFilename=!modifiedfilename:first=First !"
    set "modifiedFilename=!modifiedFilename:second=Second !"
    set "modifiedFilename=!modifiedFilename:third=Third !"
    set "modifiedFilename=!modifiedFilename:practice=Practice !"
    set "modifiedFilename=!modifiedFilename:qualifying=Qualifying !"
    set "modifiedFilename=!modifiedFilename:session=Session !"
    set "modifiedFilename=!modifiedFilename:maximum=Maximum !"
    set "modifiedFilename=!modifiedFilename:classification=Classification !"
    set "modifiedFilename=!modifiedFilename:sector=Sector !"
    set "modifiedFilename=!modifiedFilename:race=Race !"
    set "modifiedFilename=!modifiedFilename:Race s=Races!"
    set "modifiedFilename=!modifiedFilename:Racesector=Race Sector!"
    set "modifiedFilename=!modifiedFilename:history=History ! "
    set "modifiedFilename=!modifiedFilename:lapanalysis=Lap Analysis !"
    set "modifiedFilename=!modifiedFilename:analysis=Analysis !"
    set "modifiedFilename=!modifiedFilename:lapchart=Lap Chart !"
    set "modifiedFilename=!modifiedFilename:chart=Chart !"
    set "modifiedFilename=!modifiedFilename:speeds=Speeds !"
    set "modifiedFilename=!modifiedFilename:media=Media!"
    set "modifiedFilename=!modifiedFilename:press=Press!"
    set "modifiedFilename=!modifiedFilename:kit=Kit!"
    set "modifiedFilename=!modifiedFilename:eng=Eng!"
    set "modifiedFilename=!modifiedFilename:guide=Guide !"
    set "modifiedFilename=!modifiedFilename:p1=P1!"
    set "modifiedFilename=!modifiedFilename:p2=P2!"
    set "modifiedFilename=!modifiedFilename:p3=P3!"
    set "modifiedFilename=!modifiedFilename:provisional=Provisional !"
    set "modifiedFilename=!modifiedFilename:final=Final !"
    set "modifiedFilename=!modifiedFilename:starting=Starting !"
    set "modifiedFilename=!modifiedFilename:laptimes=Lap Times !"
    set "modifiedFilename=!modifiedFilename:laps=Laps!"
    set "modifiedFilename=!modifiedFilename:Laps=Laps !"
    set "modifiedFilename=!modifiedFilename:times=Times !"
    set "modifiedFilename=!modifiedFilename:grid=Grid !"
    set "modifiedFilename=!modifiedFilename:track=Track !"
    set "modifiedFilename=!modifiedFilename:control=Control !"
    set "modifiedFilename=!modifiedFilename:messages=Messages !"
    set "modifiedFilename=!modifiedFilename:pit=Pit !"
    set "modifiedFilename=!modifiedFilename:stop=Stop !"
    set "modifiedFilename=!modifiedFilename:summary=Summary !"
    set "modifiedFilename=!modifiedFilename:car=Car !"
    set "modifiedFilename=!modifiedFilename:presentation=Presentation !"
    set "modifiedFilename=!modifiedFilename:submissions=submissions !"
    set "modifiedFilename=!modifiedFilename:presentation=Presentation !"
    set "modifiedFilename=!modifiedFilename:f1=F1!"
    set "modifiedFilename=!modifiedFilename:timing=Timing !"
    set "modifiedFilename=!modifiedFilename:best=Best !"
    set "modifiedFilename=!modifiedFilename:report=Report !"
    set "modifiedFilename=!modifiedFilename:weather=Weather !"
    set "modifiedFilename=!modifiedFilename:sprint=Sprint !"
    set "modifiedFilename=!modifiedFilename:sq0=SQ0!"
    set "modifiedFilename=!modifiedFilename:shootout=Shootout !"
    set "modifiedFilename=!modifiedFilename:fastest=Fastest !"
    set "modifiedFilename=!modifiedFilename:entry=Entry !"
    set "modifiedFilename=!modifiedFilename:list=List !"
    set "modifiedFilename=!modifiedFilename:championship=Championship !"
    set "modifiedFilename=!modifiedFilename:s0=S0!"
    set "modifiedFilename=!modifiedFilename:q0=Q0!"
    set "modifiedFilename=!modifiedFilename:r0=R0!"
    set "modifiedFilename=!modifiedFilename:doc_=Doc_!"
    set "modifiedFilename=!modifiedFilename:formula1=Formula One !"	
    set "modifiedFilename=!modifiedFilename:gran=Gran!"
    set "modifiedFilename=!modifiedFilename:prix=Prix!"
    set "modifiedFilename=!modifiedFilename:version=Version!"
    set "modifiedFilename=!modifiedFilename:points=Points!"
    set "modifiedFilename=!modifiedFilename:submissions=Submissions!"
    set "modifiedFilename=!modifiedFilename:circuit=Circuit!"
    set "modifiedFilename=!modifiedFilename:map=Map!"
    set "modifiedFilename=!modifiedFilename:points=Points!"
    set "modifiedFilename=!modifiedFilename:_= !"
    set "modifiedFilename=!modifiedFilename:  = !"
    set "modifiedFilename=!modifiedFilename:event notes=Event Notes!"
    set "modifiedFilename=!modifiedFilename:lap=Lap!"
    set "modifiedFilename=!modifiedFilename:q3=Q3 !"
    set "modifiedFilename=!modifiedFilename:onTrack=On Track!"
    set "modifiedFilename=!modifiedFilename:First Practice Session=FP1!"
    set "modifiedFilename=!modifiedFilename:Second Practice Session=FP2!"
    set "modifiedFilename=!modifiedFilename:Third Practice Session=FP3!"
    set "modifiedFilename=!modifiedFilename:Car s=Cars!"
    set "modifiedFilename=!modifiedFilename:all=All!"
    set "modifiedFilename=!modifiedFilename:safety=Safety!"
    set "modifiedFilename=!modifiedFilename: .=.!"

    if not "!filename!" == "!modifiedFilename!" (
        ren "%%F" "!modifiedFilename!"
    )
)

echo
echo リネーム処理が終わりました.
timeout 5
