Skip to content

Instantly share code, notes, and snippets.

@retrography
Created May 9, 2016 13:49
Show Gist options
  • Save retrography/bcddf7da14b18e5e53131c037d697d72 to your computer and use it in GitHub Desktop.
Save retrography/bcddf7da14b18e5e53131c037d697d72 to your computer and use it in GitHub Desktop.
Data conversion / cleaning for Montreal trees data: http://donnees.ville.montreal.qc.ca/dataset/arbres
#!/bin/sh
# This is an example ran on Cote des Neiges data
# Fix text encoding
iconv -f WINDOWS-1252 -t UTF-8 Cote_des_Neiges_Notre_Dame_de_Grace_Arbres_publics_2015_12_02.csv > cdn.csv
# Remove spaces
sed -i -r 's/ +/ /g' cdn.csv
# Convert to tab-delimited
q -d ";" -T "select * from cdn.csv" > cdnfinal.csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment