Advertisement
SpikePy

filter table tennis results

Dec 30th, 2022 (edited)
1,032
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.19 KB | Sports | 0 0
  1. # go to https://tttv.click-tt.de
  2. # login with mail address
  3. # switch to tab "Downloads"
  4. # download "Vereinsspielplan (csv)"
  5.  
  6. original_results_file=Vereinsspielplan_*.csv
  7.  
  8. converted_results=results_converted.csv
  9. filtered_results=results_filtered.csv
  10.  
  11. # convert/fix character encoding
  12. iconv -f ISO-8859-1 -t UTF-8 ${original_results_file} --output="${converted_results}"
  13.  
  14. # filter output to necessary lines
  15. awk --field-separator=';' '{print $1 ";" $8 ";" $21 ";" $27 ";" $28 ":" $29}' "${converted_results}" | grep --invert-match '0:0' > "${filtered_results}"
  16. cat "${filtered_results}" | column --table --separator=';' # print result
  17.  
  18. # create file with subsets for each "Staffel"
  19. cat "${filtered_results}" | grep 'Bezirksliga Ost'          > "bezirksliga_ost_${filtered_results}"
  20. cat "${filtered_results}" | grep 'Kreisliga'                > "kreisliga_ost_${filtered_results}"
  21. cat "${filtered_results}" | grep 'Jugendbezirksliga Ost'    > "jugendbezirksliga_ost_${filtered_results}"
  22. cat "${filtered_results}" | grep 'Jugendkreisliga'          > "jugendkreisliga_${filtered_results}"
  23. cat "${filtered_results}" | grep 'Kreisligapokal Unterland' > "kreisligapokal_unterland_${filtered_results}"
  24.  
Tags: tabletennis
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement