23 lines
460 B
Perl
23 lines
460 B
Perl
#!/usr/bin/env perl -w
|
|
|
|
# Reformat data from Metoffice for use in GNUPlot
|
|
# curl http://www.metoffice.gov.uk/hadobs/hadukp/data/daily/HadSEEP_daily_qc.txt | perl getrainfall.pl
|
|
|
|
use strict;
|
|
|
|
<>; <>; <>; # swallow first three lines
|
|
|
|
while(<>) {
|
|
chomp;
|
|
s/^\s*//;
|
|
my ($year, $month, @data) = split (/\s+/);
|
|
next unless $year >= 2014;
|
|
|
|
my $day = 1;
|
|
foreach(@data) {
|
|
next if $_ < 0;
|
|
printf("%04d-%02d-%02d %s\n", $year, $month, $day, $_);
|
|
$day++;
|
|
}
|
|
}
|