Ticket #702: igo2navittext.pl

File igo2navittext.pl, 393 bytes (added by tegzed, 8 years ago)

changed to more perl-ish syntax

Line 
1#!/usr/bin/perl
2
3while(<>) {
4  $line = $_;
5  if( $line=~ /^([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,\n]+)$/) {
6    print "$1 $2 type=tec_common tec_type=$3 maxspeed=$4 tec_dirtype=$5 tec_direction=$6\n";
7  }
8  elsif( $line=~ /^([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,]+),([^,\n]+)$/) {
9    print "$2 $3 type=tec_common tec_type=$4 maxspeed=$5 tec_dirtype=$6 tec_direction=$7\n";
10  }
11}
12