Added more industries

This commit is contained in:
vjrj 2018-02-27 16:50:26 +01:00
parent dc92574bc3
commit a3bdcb3982
4 changed files with 63 additions and 0 deletions

16
bin/au-dee-npi.awk Executable file
View file

@ -0,0 +1,16 @@
# cat file.csv| ./au-dee-npi.awk | mongoimport -d "fuegos" -c "industries"
gawk -F',' 'NR>1 { \
gsub(/"/,"",$5);
gsub(/"/,"",$6);
gsub(/\t/,"",$13);
gsub(/\t/,"",$14);
gsub(/\x1a/,"",$13);
gsub(/\x1a/,"",$14);
lon = $14+0;
lat = $13+0;
name= $5", "$6
gsub(/^, /,"",name);
if (lon != 0 && lat != 0 && lon > -180 && lon < 180 && lat >= -90 && lat <= 90)
printf("{name:\"%s\",geo:{type:\"Point\",coordinates:[%s,%s]},registry:\"4\"}\n" \
,name,lon,lat)}'

19
bin/ca-godp-npri.awk Executable file
View file

@ -0,0 +1,19 @@
# cat file.csv| ./ca-godp-npri.awk | uniq | mongoimport -d "fuegos" -c "industries"
gawk -F',' 'NR>1 { \
gsub(/"/,"",$3);
gsub(/"/,"",$4);
gsub(/\t/,"",$3);
gsub(/\t/,"",$4);
gsub(/\x1a/,"",$3);
gsub(/\x1a/,"",$4);
lon = $16+0;
lat = $15+0;
if ($3 != $4)
name= $3", "$4
else
name=$3
gsub(/^, /,"",name);
# if (lon != 0 && lat != 0 && lon > -180 && lon < 180 && lat >= -90 && lat <= 90)
printf("{name:\"%s\",geo:{type:\"Point\",coordinates:[%s,%s]},registry:\"3\"}\n" \
,name,lon,lat)}'