
I needed a tool to split Cutechess log files, so I made this Lua script. Maybe someone will find it useful.

What I call Cutechess log file is what I get when I run this kind of command:

$HOME/Documents/echecs/sources/cutechess/1_5_1/build/cutechess-cli \
-rounds 2 \
-tournament gauntlet \
-engine conf="Fimbulwinter 260913" \
-engine conf="Zoe 0.4" \
-engine conf="miniMardi 1.3" \
-engine conf="OliveChess 0.3.3" \
-engine name="Alouette 0.1.9" cmd="./alouette" dir="/home/roland/Documents/pascal/echecs/alouette/git" proto="uci" \
-each tc=40/30 option.Threads=1 \
-openings file=$BOOK plies=4 order=random \
-debug all \
-pgnout tournoi.pgn \
-wait 500 2>> tournoi.err | tee tournoi.log

The script is a bit slow and can look a bit complicated because it deals with the case of lines arriving late, like this:

Finished game 2 (Fimbulwinter 260913 vs miniMardi 1.3): 1/2-1/2 {Draw by fifty moves rule}
265554 >Fimbulwinter 260913(4): xboard
265554 >Fimbulwinter 260913(4): protover 2
265554 >OliveChess 0.3.3(5): uci
265554 >miniMardi 1.3(3): quit <-- This line belongs to the previous game

It creates a file for each game. For now the files are named game1.log, game2.log...

Usage: lua split-cutechess-log.lua LOGFILE_NAME
