gmzorz

OCC score calculator

Jun 8th, 2020
2,384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.72 KB | None | 0 0
  1. @echo off
  2. setLocal enableDelayedExpansion
  3.  
  4. REM using imported data from the judges' evaluation sheet
  5.  
  6. REM *.res files are formatted like this:
  7. REM "//RATING-CATEGORY_CONTESTANT
  8. REM 72-Flow_Striker
  9. REM 75-SFX_Striker
  10. REM 79-Theme_Striker
  11. REM 62-CC_Striker
  12. REM 75-Creativity_Striker
  13. REM 68-Flow_Kibi
  14. REM 1-SFX_Kibi
  15. REM 71-Theme_Kibi
  16. REM 66-CC_Kibi
  17. REM 75-Creativity_Kibi
  18. REM 50-Flow_NerwinLeevayy
  19. REM 53-SFX_NerwinLeevayy
  20. REM 52-Theme_NerwinLeevayy
  21. REM 52-CC_NerwinLeevayy
  22. REM 50-Creativity_NerwinLeevayy"
  23.  
  24. set /a "count=0"
  25. for %%a in ("*.res") do (
  26.     set /a "count+=1"
  27.     for /f %%b in (%%a) do (
  28.         for /f "tokens=1,2 delims=-" %%c in ("%%b") do (
  29.             set /a "_%%d=!_%%d!+%%c"
  30.         )
  31.     )
  32. )
  33.  
  34. REM SFX counts half
  35. for /f "tokens=1,2 delims==" %%a in ('set _SFX') do (
  36.     set /a "%%a=%%b/2"
  37. )
  38. REM divide by amount of judges
  39. REM for /f "tokens=1,2 delims==" %%a in ('set _') do (
  40.     REM set /a "%%a=%%b/count"
  41. REM )
  42.  
  43. :export
  44. REM separate topics
  45. for %%a in (Flow, CC, SFX, Theme, Creativity) do (
  46.     if exist %%a.txt del /s /q %%a.txt
  47.     for /f "tokens=1,2 delims==" %%b in ('set _%%a') do (
  48.         echo %%c: %%b >> %%a.srt
  49.     )
  50.     if exist %%a_sorted.txt del /s /q %%a_sorted.txt
  51.     sort /r %%a.srt >> %%a_sorted.txt
  52.     del /s /q %%a.srt
  53.     ren %%a_sorted.txt %%a.txt
  54. )
  55.  
  56. :exportavg
  57. REM average on all topics
  58. set /a "count=0"
  59. for %%a in (Flow, CC, SFX, Theme, Creativity) do (
  60.     set /a "count+=1"
  61.     for /f "tokens=1,2,3 delims==_" %%b in ('set _%%a_') do (
  62.         set /a "avg_%%c=!avg_%%c!+%%d"
  63.     )
  64. )
  65. for /f "tokens=1,2 delims==" %%a in ('set avg_') do (
  66.     set /a "fix=!%%a!/5"
  67.     REM echo %%a !fix!
  68.     echo !fix!: %%a >> avg.srt
  69. )
  70. if exist avg_sorted.txt del /s /q avg_sorted.txt
  71. sort /r avg.srt >> avg_sorted.txt
  72. del /s /q avg.srt
  73. pause
Advertisement
Add Comment
Please, Sign In to add comment