Wikipedia talk:WikiProject New Jersey/Census 2010/Demographics

Generated from csv export of [1] running through the following perl script:

#!/usr/bin/perl

my $type;

while(<>) {
        chomp;
        s/,"([0-9]+),([0-9]{3}),([0-9]{3})",/,\1\2\3,/g;
        s/,"([0-9]+),([0-9]{3}),([0-9]{3})",/,\1\2\3,/g;
        s/,"([0-9]+),([0-9]{3})",/,\1\2,/g;
        s/,"([0-9]+),([0-9]{3})",/,\1\2,/g;
        s/,"([0-9]+),([0-9]{3})\.([0-9]+)",/,\1\2.\3,/g;
        s/,"([0-9]+),([0-9]{3})\.([0-9]+)",/,\1\2.\3,/g;
        s/^" */"/;
        s/CDP \((.*) County\), New Jersey"/CDP; \1 County/;
        if (/CDP, New Jersey/) {
                $type="CDP";
                s/, New Jersey"//;
        }
        if (/(city|borough|village|town), New Jersey/) {
                $type="$1";
                s/ (city|borough|village|town), New Jersey"//;
        }
        if (/township,/) {
                $type="township";
                s/township,/Township;/;
                s/County"/County/;
        }
        if (/County,/) {
                $type="county";
                s/^ *//;
        }
        s/^"//;
        split(/,/);
        print "{{USCensusDemographics|year=2010|type=$type|place=";
        print join('|', @_);
        print "}}\n";
}