I currently don't zero-pad dates/times to conform to ISO8601 format for dates/times which causes problems when I sort by date. Currently I use some sed-fu to work around this by fixing the dates like so:
$ cat output.csv | sed -r 's/([0-9]{4})\-([0-9])\-([0-9])/\1-0\2-\3/' | sed -r 's/([0-9]{4})\-([0-9]{2})\-([0-9]),/\1-\2-0\3,/' > output_fixed_dates.csv
Then I fix the times like so:
$ cat output_fixed_dates.csv | sed -r 's/,([0-9])(:[0-9]{1,2}:[0-9]{1,2}),/,0\1\2,/' | sed -r 's/,([0-9]{2}:)([0-9]:)([0-9]{1,2}),/,\10\2\3,/' | sed -r 's/,([0-9]{2}:)([0-9]{2}:)([0-9]),/,\1\20\3,/' > output_fixed_dates_and_times.csv
You could certainly do it all in one command but I like iterative error checking / validation.
But this is trivial to fix in the code so I should do that rather than having to resort to such sed-fu.
I currently don't zero-pad dates/times to conform to ISO8601 format for dates/times which causes problems when I sort by date. Currently I use some sed-fu to work around this by fixing the dates like so:
Then I fix the times like so:
You could certainly do it all in one command but I like iterative error checking / validation.
But this is trivial to fix in the code so I should do that rather than having to resort to such sed-fu.