#!/usr/bin/perl use strict; use warnings; use OSM::osm; my @fieldNames = qw(name amenity operator vending); openOsmFile($file); do { my ($id, $lon, $lat, $nodeUser, $ref1) = getNode2(); last if ! defined $id; my %fields; $fields{$_->[0]} = scalar $_->[1] for @$ref1; next if !grep {exists $fields{$_}} @fieldNames; print join ('^', $id, $lat, $lon, @fields{@fieldNames}), "\n"; } while (1); closeOsmFile();