#!/usr/bin/awk -f # # H.A.Trujillo, 26 Oct 09 # Latest Change: 1 Jul 15 (updated for new Rosters page) # # # A pass-through filter to turn student registration PINs (pasted directly # from Rosters) into something printable for distribution to students. # # # USAGE: pbpaste | PIN [ | lpr | papercutter > student ] # or PIN < tempfile # # Data should be copied from the "tabbed roster" page. # BEGIN{ FS = "\t" print \ "\n\tVerify the output left in \033[4m/tmp/PinList.ps\033[m is ok, then print\n" } /900-/{ # (last,first ID PIN) printf("%-20s \t%10s\t%6d\n", $2", "$1, $3, $4) > "/tmp/PinList" } END { close ("/tmp/PinList") system("sort -r /tmp/PinList | \ enscript -2rBs61 -fCourier11 --margins=-25::: -p/tmp/PinList.ps ; \ rm /tmp/PinList") } # Input Data fields: # 1 First # 2 Last # 3 WIN # 4 PIN # 5 Degree # 6 Major # 7 Class # 8 Email # # vim: tw=0 nowrap