Skip to content

Instantly share code, notes, and snippets.

@rweald
Last active December 12, 2015 05:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rweald/4720846 to your computer and use it in GitHub Desktop.
Save rweald/4720846 to your computer and use it in GitHub Desktop.
Grab NPI numbers that could not be geocoded with high degree of confidence
#!/usr/bin/env bash
# Requires CSVKit to be installed
# To install use pip install csvkit
cat geocoded_npi.csv | ruby -e 'STDIN.each { |l| fields = l.split(","); puts l if fields[3].to_f < 0.5 }' > lower-confidence-npis.csv
# Depending which address field you want to use you should change the column indexes
csvcut -c 1,29-33 full_nip_datadump.csv > npi-to-address.csv
csvjoin -c 1 npi-to-address.csv lower-confidence-npis.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment