stud/IV/filter-rivers-query.awk

13 lines
295 B
Awk
Raw Normal View History

2021-03-13 15:53:22 +02: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 ";";
}