O'Reilly logo

Baseball Hacks by Joseph Adler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Make Box Scores or Database Tables from Play-by-Play Data with Retrosheet Tools

Turn historical event files into box scores, summary statistics, and events suitable for database import using Chadwick and the DiamondWare tools.

It’s pretty tough to work directly with the Retrosheet event files. They contain a description of everything that happened, but they’re dense and hard to read. Two sets of tools can make things easier. These tools turn the event files into box scores and tables suitable for databases. There’s even a new GUI-driven tool that can help you explore these files.

These tools don’t include any data, nor do they fetch it from the Internet. Before using them, you’ll need to get some baseball data. See “Get Historical Play-by-Play Data” [Hack #14] for more information.

A company called DiamondWare developed a set of three tools for Microsoft Windows for processing Retrosheet–style event files. These are:

BGAME

The BGAME tool will import an event file and output a CSV file with one line per game containing summary statistics about each game. These statistics include home team, visiting team, runs scored, starting pitchers, umpires, starting lineups, and other information about each game.

BOX

The BOX tool generates a set of box scores from a historical event file. Many users will find a one-page box score easier to understand than 200 lines of event codes.

BEVENT

The BEVENT tool will import an event file and output a CSV file with one event per line, suitable for import into ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required