#!/bin/sh

# Filters the output CSV from
#     script/16WW-mains-water-inlet-temperature-toCSV.sh
# to retain only one value from each month.
# This retains the first value from each month.
# This does not insert anything for missing months.
#
# Input rows of form:
#    2008-11-19,14

awk -F, '{
    YYYYMM=substr($1, 1, 7);
    if(LASTYYYYMM != YYYYMM) {
        LASTYYYYMM = YYYYMM;
        print $0
        }
    }'
