|
Home |
Creating a scoresheetThe 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.
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. NVFAQWhy 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. |