stud/IV/filter-rivers-query.awk

13 lines
294 B
Awk
Raw Normal View History

2021-03-13 15:53:22 +02:00
#!/usr/bin/awk -f
BEGIN {
2021-03-13 15:57:26 +02:00
print "DROP TABLE IF EXISTS rivers;"
2021-03-13 15:53:22 +02:00
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 ";";
}