View Single Post
  #24   Spotlight this post!  
Unread 13-05-2016, 15:28
markmcgary's Avatar
markmcgary markmcgary is online now
Software Mentor
FRC #4322 (Clockwork Oranges)
Team Role: Mentor
 
Join Date: Feb 2012
Rookie Year: 2012
Location: Fullerton, CA
Posts: 179
markmcgary is just really nicemarkmcgary is just really nicemarkmcgary is just really nicemarkmcgary is just really nicemarkmcgary is just really nice
Re: Jaci's Annual FRC Datadump 2016

Quote:
Originally Posted by Ether View Post
I haven't done SQL in decades. I just cobbled up an AWK script to read the match_teams table.

Code:
(ac=="red") && ($3=="red"){red+=$4; next}

(ac=="blue") && ($3=="blue"){blue+=$4; next}

(ac=="red") && ($3!="red"){
	if(red>max){max=red; idmax=$1}
	if(red<min){min=red; idmin=$1}
	ac="blue"; blue=$4; next}

(ac=="blue") && ($3!="blue"){
	if(blue>max){max=blue; idmax=$1}
	if(blue<min){min=blue; idmin=$1}
	ac="red"; red=$4; next}
I had to do a little AWK research. If I read this correctly, your idmax and idmin will point to the record in match_teams that immediately follows the max/min alliances?

It's amazing how many tools there are to accomplish a given task. Always something new to learn.
Reply With Quote