in reply to insert null in missing rows
This code might help to loop, and prepend 0 to numbers smaller than 2 digits:
# First, we read the file, put the data into a hash # now, we loop on the day: $day = '2016-02-06'; for $hour (00..23){ for($min=00;$min<60; $min+=10){ $key = sprintf("%s,%02d:%02d", $day,$hour,$min); print "Checking if $key:00 exists\n"; } }
ps: The real world solution is using a RRD (round robin database)
|
|---|