tex: Move expert-base knowledge info to latter sections
[gostyle.git] / data_summarize.sh
blob2ff70ddeafb60388d73863f17586e480480ec350
1 #!/bin/sh
3 # data_summarize.sh - Summarize raw per-player pattern data by pattern frequency
5 # Usage: data_summarize.sh PLAYERLIST RAWPATDIR PATDIR
7 players=$1; shift
8 rawpatdir=$1; shift
9 patdir=$1; shift
11 [ -d "$patdir" ] || {
12 echo "Creating dir $patdir"
13 mkdir -p "$patdir" || {
14 echo "Couldn't create $patdir.Exit." >&2 ; exit 1 ; } ; }
17 summarize() {
18 sort | uniq -c | sort -rn
21 # per-player pattern data
22 cat "$players" | while read player; do
23 echo "$player"
24 cat "$rawpatdir/$player" | summarize >"$patdir/$player"
25 done
27 # summary pattern data
28 echo "all.pat"
29 cat "$players" | while read player; do cat "$rawpatdir/$player"; done |
30 summarize >"$patdir/../all.pat"