RED BAT CRICKET COLLECTIVE

 

   

Home
The Constitution
History
Fixtures
AGMs/EGMs
Averages
Records
Features
Picture Gallery   Links

Creating a scoresheet

The first step in the process is to convert any information which you can extract from the scorebook into a text file known as a .sbs (Score Book Summary) file.  The format of this file is fairly simple, but there are a few tricky points.  The easiest way to understand it is to look at this example.

20060828bish.sbs Notes
+version
   version:3.01
+match
   hometeam:Bishops Castle Casualties CC
   awayteam:RBCC
   date:28 August 2006
   venue:Bishops Castle CC, Shropshire
   matchType:40 overs
   result:w
   margin:22r ![nW, mR] n wickets or m runs
   matchid:20060828bish
   comment:The long-awaited 100th victory
+innings
   number:1
   team:RBCC
   runs:166
   wickets:3
   nb:1
   w:8
   b:18
   lb:1
   ex:28
   ! fall of wickets : wkt-score/batsmanOut
   fw:1-109/2,2-148/1,3-154/3
   comment:Batting total 166, bowling 169. 
+innings
   number:2
   team:Bishops Castle Casualties
   runs:144
   wickets:8
   nb:
   w:
   b:
   lb:
   ex:22 ! ex: overrides sum of elements if different
   ! fall of wickets : wkt-score/batsmanOut
+team
   name:RBCC
   ! pl:name;
   !    player-no,runs,howOut,bowler,assist,balls,mins;
   !    bowler-no,overs,mdns,runs,wkts,ct,st
   pl:P.Jones;1,60,lbw,7;
   pl:J.Harry;2,57,c,6;7,3,0,29,1,1
   pl:M.Gummer;3,10,lbw,7;6,3,0,7,1
   pl:A.Lee;4,4,not;4,6,1,7,2
   pl:D.Muir;5,7,not;5,3,0,17,1
   pl:+C.Lewis;6;,,,,,,1
   pl:D.Whitelock;7;1,6,1,15,0
   pl:J.Anzani;8;8,1,0,13,1
   pl:B.Kennedy;9;2,6,1,13,1
   pl:K.Miller;10;3,6,0,37,0
   pl:*P.O'Connor;11;9,1,0,4,0
+team
   name:Bishops Castle Casualties
   ! pl:name;
   !    player-no,runs,howOut,bowler,assist,balls,mins;
   !    bowler-no,overs,mdns,runs,wkts
   pl:I.Hobbs;1,38,b,3;5,5,1,22,0
   pl:J.Bryce-Smith;2,7,run
   pl:John.Rowland;3,1,c,9,sub (A.Harry);7,2,0,7,0
   pl:C.Dunnett;4,17,b,4;4,3,0,14,0
   pl:J.Gaffney;5,5,c,4,sub (A.Harry)
   pl:P.Price;6,6,st,8,6;6,4,0,20,1
   pl:S.Gaffney;7,0,c,5,2;8,3,1,20,2
   pl:O.Biggs;8,10,b,2;9,2,0,11,0
   pl:S.Dunnett;9,13,not;3,5,1,21,0
   pl:Jake.Rowland;10,25,not;1,5,2,9,0
   pl:Knott;11;2,6,1,26,0

 

The file is divided into sections starting with a +name line.  The current sbs version is 3.01.  Anything preceded by a "!" is ignored as a comment.

The +match section gives a summary of the result.  Each item of data has a label ending with a ":" (eg hometeam:).  Most of these should be self-evident.  The "matchid:" label is always the match date (yyyymmdd) followed by the first 4 characters of the opponents' name, to provide a unique ID for the game.  One or more comment:s can be given here if you wish and will appear in the scoresheet.

There is a +innings section for each innings, giving the innings number (1-2, or 1-4 for a two-innings match), some details of the innings, and (via team:) the name of the batting side. The fw: label gives fall-of-wicket info as w-s/b where w = wicket number, s = score at fall, b = outgoing batsman.  b can be left out if it's unknown. Extras are given here (4 categories + total).

There is a +team section for each team (I told you it was simple).  The name: here must be exactly the same as the team: name in the +innings section, so cut&paste to make sure it's right.  Each player has a pl: line to record their day's work.  The pl: line has 3 sections separated by ";"s: players name; batting data (number,runs,how-out,bowler,assist); bowling data (number,overs,maidens,runs,wickets,catches,stumpings)

The players are always referred to by their position in the batting order (for 1st innings if 2-innings match), and the pl: lines must be written in this order.  Note that every player must be assigned a batting position even if they did not bat.

Captain and keeper can (and should for RBCC) be marked by * and + before or after their name.  Don't leave any spaces in the name.

How-out is any sensible abbreviation (eg b, c, ct, st, run, not, hit); identify the bowler by number if the bowler gets the wicket; identify the assistant (catcher, stumper) if relevant and if known.  Note that a name can be given instead of a number for the bowler or assistant if you wish (cf John Rowland dismissal in BCC innings). Note also that the bowler is always given first - the opposite of the scorebook.  Balls faced and minutes at the crease can also be added as extra fields after the assist.

Bowling data is pretty obvious - irrelevant fields can be left out as long as commas are written as place-holders (cf +C.Lewis - did not bowl, 1 stumping).

 

The second step is to run this perl script like this.

perl readSbs3.pl -h 20060828bish.sbs

You will then have a new file called (in this case) 20060828bish.htm.  If you have created a number of .sbs files in the same directory you can generate all of the html files in one go like this:

perl readSbs3.pl -h   .*\.sbs

The slightly tricky syntax here (dot star backslash dot sbs) is an example of a regular expression - if you need to know what this is you probably already do.

NVFAQ

Why not type the information straight into an html file ?  The main answer is that this file format allows the information to be read easily by a variety of programs which can (a) generate html files, (b) calculate averages, and (c) do any other statistical calculations you can think of.

Why not use XML ? I tried this.  The files were 5 times bigger with the vast majority of the space taken up with XML tags.

Where do I get this perl script ? Take a copy of from here and save it as readSbs3.pl

Hang on, what's perl ? You'll be needing to download the perl interpreter then.

What if there are more than XI players ? Just add extra pl: lines with the right player numbers.

Why is my html file blank/garbled ? The perl script has almost no error detection, and it just ignores anything it can't understand.  So mistakes in the sbs file are likely to show up as blank sections in the html scoresheet.  Avoid leaving spaces in the pl: lines, make sure that all players have a batting position and that the team list is given in batting order, and ensure that the +innings team: label and the +team name: label are identical.

There's an empty sbs file available to make life easy, isn't there ? Yes.

What if there's a two-innings match ? Just add an extra +innings section with the correct number: label for each innings, and extend the pl: lines with additional sections (always in the order batting/bowling/batting/bowling) like this.

How long does all this take ? Given a nice clean, clear scorebook to copy up, about 10 minutes per match after a bit of practice.  If the scorebook is imperfect (and this is not unknown) allow a little longer - how much longer will depend on the degree of analysis and reconstruction required to extract sensible information.