football-cat - concatenate football.csv datafiles - make out of many, one
- home :: github.com/sportdb/football.db
- bugs :: github.com/sportdb/football.db/issues
- gem :: rubygems.org/gems/football-cat
- rdoc :: rubydoc.info/gems/football-cat
- forum :: opensport
Usage
Run this tool to concatenate match files (for football clubs or national teams) in the one-line, one-match & one-file, one-season Football.CSV format
into one
PLUS (auto-)adding the missing league and season headers / columns
inferred from the file's basename (e.g. es.1.csv => ES1)
and the file's directory (e.g. /2020-21/ => 2020/21). Example:
$ football-cat espana.csv espana
Concatenates all match files in the espana directory
(and all its subdirectories) into the single-file espana.csv
plus (auto-)adding two new leading columns, that is, league and season.
/footballcsv/espana
and looking into 2010s/2012-12/es.1.csv, for example:
Round,Date,Team 1,FT,Team 2
1,Sat Aug 18 2012,RCD Mallorca,2-1,RCD Espanyol
1,Sat Aug 18 2012,Sevilla FC,2-1,Getafe CF
1,Sat Aug 18 2012,RC Celta Vigo,0-1,M
becomes the all-in-one espana.csv:
League,Season,Round,Date,Team 1,FT,Team 2
ES1,2012/13,1,Sat Aug 18 2012,RCD Mallorca,2-1,RCD Espanyol
ES1,2012/13,1,Sat Aug 18 2012,Sevilla FC,2-1,Getafe CF
ES1,2012/13,1,Sat Aug 18 2012,RC Celta Vigo,0-1,M
Note: You can pass along more than one directory to the tool. Let's concatenate the top leagues from the football.csv org:
$ football-cat top.csv footballcsv/england \
footballcsv/espana \
footballcsv/deutschland
That's all for now. Happy data wrangling. Enjoy the beautiful game.
Datasets
For some open public domain Football.CSV datasets to get started, see the football.csv org.
Add your datasets here!
Installation
Use
gem install football-cat
or add the gem to your Gemfile
gem 'football-cat'
License
The football-cat scripts are dedicated to the public domain.
Use it as you please with no restrictions whatsoever.
Questions? Comments?
Send them along to the Open Sports & Friends Forum/Mailing List. Thanks!