#!/usr/bin/perl # Make individual KML files for ICOADS data in the Southern Ocean. use strict; use warnings; use FindBin; for ( my $Year = 1895 ; $Year < 1940 ; $Year++ ) { my $Infile = sprintf "%s/../../icoads_data/%04d-%04d", $FindBin::Bin, $Year, $Year + 1; my $Outfile = sprintf "%s/../icoads_data_kml/%04d-%04d.kml", $FindBin::Bin, $Year, $Year + 1; # Make last year - removing redundant digitis my $Lastyear = $Year + 1; if ( int( $Lastyear / 100 ) == int( $Year / 100 ) ) { $Lastyear = $Lastyear % 100; } my $Title = sprintf "%04d-%d", $Year, $Lastyear; `imma_to_kml.perl --title=$Title < $Infile > $Outfile`; }