#!/usr/bin/perl # Copyright : http://www.fsf.org/copyleft/gpl.html # Author 作者 : 積丹尼 Dan Jacobson -- http://jidanni.org/ # Created On : Wed Jun 7 01:52:02 2017 # Last Modified On: Thu Jun 8 15:43:35 2017 # Update Count : 34 # 將某 TXT 轉 GPX use strict; use warnings FATAL => q(all); use XML::TreePP; my $tree; while (<>) { s/ (號)/$1/; my @F = split; next unless $#F > 2; die unless $#F == 6; next if $F[4] eq '東經度'; push @{ $tree->{gpx}->{wpt} }, { '-lat' => ll( $F[5] ), '-lon' => ll( $F[4] ), name => $F[1], desc => "