#!/bin/bash

if [ -z "$1" ] || [ ! -f "$1" ]; then
	echo "Usage: $0 file"
	exit 0
fi

INPUT="$1"

echo "Block Height,Timestamp,Transaction Count,Scripthash Count,Processing Time (msec)"
cat $INPUT | sed -n 's/\[\([-:\. 0-9]*\)\].*Saved .* undo for block \([0-9]\+\), \([0-9]\+\) transaction.*involving \([0-9]\+\) scripthash.*, in \([\.0-9]\+\) msec.*/\2,\1,\3,\4,\5/p'

