in2csv parsing of time values has changed in 1.0.6: is there a --datetime-format fix?

Viewed 26

I'm having a problem with an incompatibility in the conversion of Excel times (format [m]:ss.00) to csv between in2csv 1.0.6 and previous versions.

With the 2015 version (0.6something? no '-V'), the time was, I think, always converted to a float. The downstream code that parsed the csv first checked for a value in the form [m]:ss.00, and then fell back to parsing a float, so this was Ok. This has changed in in2csv 1.0.6. The new behavious is unaffected by --no-inference.

Assuming an input of 1 minute 34.27 seconds, for example, which is displayed as 1:34.27 in Excel, then:

  1. if the input is an xlsx file, the output is 00:01:34.270000
  2. if the input is an xls file, the output is 0.00109108796296

the second output is Ok, but I can't force users to supply xls files, so I need to deal with the first output as well. --datetime-format makes no difference:

$ in2csv --datetime-format "%M:%S.%f" Excel2019.xlsx

still produces 00:01:34.270000.

Can I fix this with another datetime-format? I can do the fix in the downstream parsing if necessary, but this would be a last resort - I don't really want to check for three potential inputs.

0 Answers
Related