#! /usr/bin/gawk -f # Last edited on 2011-06-22 23:00:43 by stolfi BEGIN { FS = "|"; } # Get rid of TABs, if any: // { gsub(/[\011]/, " ", $0); } # Discard blank lines: /^[| ]*$/ { next; } # Convert comment lines into #-comments: /(Taxa de|Taxas de|Minist|Institu)/ { gsub(/[|]/, " ", $0); gsub(/^[ ]+/, "", $0); gsub(/[ ]+$/, "", $0); gsub(/[ ][ ]+/, " ", $0); printf "# %s\n", $0; next; } /^20[01][0-9][|]/ { yr = $1; re = $2; uf = $3; ur = $4; fi = $5; for (se = 1; se <= 8; se++) { ap[se] = $(); re[se] = $(); ab[se] = $(); } }