Created
January 25, 2013 21:49
-
-
Save thibaudcolas/4638199 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
cat geonames_insee_reg_dept.rdf | grep 'rdf:about' | cut -c 25-56 | sort > reg_dept.txt | |
cat reg_dept.txt | grep . | sed 's/$/about.rdf/' > reg_dept_links.txt | |
wget -i reg_dept_links.txt -O geonames_tmp.rdf | |
cat geonames_tmp.rdf | grep '?xml' | uniq > geonames_reg_dept.rdf | |
cat geonames_tmp.rdf | grep '<rdf:RDF' | uniq >> geonames_reg_dept.rdf | |
cat geonames_tmp.rdf | grep -v '?xml' | grep -v 'rdf:RDF' >> geonames_reg_dept.rdf | |
cat geonames_tmp.rdf | grep '</rdf:RDF' | uniq >> geonames_reg_dept.rdf | |
wc -l geonames_reg_dept.rdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment