Advertisement
Guest User

Untitled

a guest
Nov 1st, 2019
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.06 KB | None | 0 0
  1. ##download marathon times and convert to tsv:
  2.  
  3. curl "http://www.alltime-athletics.com/mmaraok.htm" | grep "\d:\d\d:\d\d" | perl -pe 's/<.*?>//g' | perl -pe 's/  +/\t/g' > marathon.tsv
  4.  
  5. ##print sub-2:10 count by year:
  6.  
  7. cat marathon.tsv| grep "2:0[0-9]" | perl -pe 's/^.*\.(\d\d\d\d).*$/\1/' | sort | uniq -c
  8.  
  9. ##print sub-2:09 count by year:
  10.  
  11. cat marathon.tsv| grep "2:0[0-8]" | perl -pe 's/^.*\.(\d\d\d\d).*$/\1/' | sort | uniq -c
  12.  
  13. ##print sub-2:08 count by year:
  14.  
  15. cat marathon.tsv| grep "2:0[0-7]" | perl -pe 's/^.*\.(\d\d\d\d).*$/\1/' | sort | uniq -c
  16.  
  17. ##...etc
  18.  
  19. ##print sub-2:10 by year excluding November and December:
  20.  
  21. cat marathon.tsv| grep "2:0[0-9]" | grep -v "1[12]\.\d\d\d\d" | perl -pe 's/^.*\.(\d\d\d\d).*$/\1/' | sort | uniq -c
  22.  
  23. ##print sub-2:10 count by athlete:
  24.  
  25. cat marathon.tsv | grep "2:0[0-9]" | perl -pe 's/ /_/g' | awk '{print $3}' | sort | uniq -c | sort -k 1n
  26.  
  27. ##print sub-2:10 count by location:
  28.  
  29. cat marathon.tsv | grep "2:0[0-9]" | perl -pe 's/^.*\t([^\t]+)\t\d\d\.\d\d\.\d\d\d\d.*$/\1/' | sort | uniq -c | sort -k 1n
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement