Baseball and Databases

Converting the MySQL dump to SQLite3 file

Here are two scripts:

The scripts:

REQUIRES: sqlite3, perl, curl, unzip, bash


Be sure to chmod these files to make them executable

chmod +x
chmod +x

Basically the shell script fetches the data from the web and unzips it, and then passes it off to the script that does the conversion.

curl -O
./ BDB-sql-2008-03-28.sql | sqlite3 baseball.db

The conversion script uses perl to modify the format of the files from mysql to sqlite3.