Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/awk -f
- BEGIN {
- FS = "|"
- }
- FNR == NR {
- chans[++ch] = $0;
- }
- {
- fips[$1];
- coun[$1] = $7;
- stat[$1] = $8;
- own[$1,$4] = ((c[$1,$4]++) ? own[$1,$4] " & " $2" ("$6")" : $2" ("$6")");
- }
- END {
- printf("%s\t%s\t%s\t", "COUNTY", "STATE", "FIPS");
- for (i=1; i<=ch; i++) {
- printf("%s\t", chans[i]);
- }
- printf("\n");
- for (f in fips) {
- printf("%s\t%s\t%s\t", coun[f], stat[f],f);
- for (i=1; i<=ch; i++) {
- printf("%s\t", own[f,chans[i]]);
- }
- printf("\n");
- }
- }
Add Comment
Please, Sign In to add comment