diff options
Diffstat (limited to 'scripts/gen-2002')
-rwxr-xr-x | scripts/gen-2002 | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/scripts/gen-2002 b/scripts/gen-2002 new file mode 100755 index 0000000..3fa0946 --- /dev/null +++ b/scripts/gen-2002 @@ -0,0 +1,76 @@ +#!/bin/sh + +gawk -v denom=$1 ' +@include "scripts/getcls.awk" + +BEGIN { + FS = "\t" +} + +FILENAME == "data/country-info" { + cc2name[$1] = $3 +} + +FILENAME == "data/note-info" && length == 0 { + section++ + next +} + +FILENAME == "data/note-info" && section == 0 { + cc2c[$1] = $2 +} + +FILENAME == "data/note-info" && section == 1 { + ab2l[$1] = $2 +} + +FILENAME == "data/notes" && $1 == denom && $2 == "2002" { + i++ + col[i][0] = $3 + col[i][1] = $4 +} + +END { + asort(col) + for (i = 1; i <= 3; i++) { + if (i == 3 && denom == 5) + break + + switch (i) { + case 1: + sig = "Wim Duisenberg" + break + case 2: + sig = "Jean-Claude Trichet" + break + case 3: + sig = "Mario Draghi" + break + } + + printf "tr .new-design {th colspan=\"12\" {-%s}}\n", sig + c = 1 + + for (j = 1; j <= length(col); j++) { + split(col[j][1], s, " ") + if (s[i] == "/") + continue + + if ((c - 1) % 4 == 0) + printf "trX {" + + printf "td colspan=\"X\" .%s {-%s (%s)}", getcls(s[i]), + cc2name[col[j][0]], cc2c[col[j][0]] + + if (c % 4 == 0) + print "}" + c++ + } + if ((c - 2) % 4 != 3) + print "}" + } + print "__MARKER__" +} +' data/country-info data/note-info data/notes \ +| scripts/colspan.sed \ +| scripts/last-of-design.sed |