wm/filter-rivers-query.awk

13 lines
295 B
Awk
Raw Normal View History

2021-05-19 22:57:46 +03:00
#!/usr/bin/awk -f
BEGIN {
print "DROP TABLE IF EXISTS rivers;";
printf "CREATE TABLE rivers AS SELECT name,way FROM planet_osm_line WHERE "
for (i = 1; i < ARGC; i++) {
printf "name='%s'", ARGV[i]
if (i != ARGC - 1)
printf " OR ";
}
print ";";
}