CSV-Export from Command Line
I'd like to kick off the CSV-Export from the command line. Basically, what i'm looking for is something that i can automate somewhat like this:
ManicTime.exe --export="Tags" > mttags.csv
ManicTime.exe --export="Applications" > mtapps.csv
and so on. It does not need to be exactly like that, but if I could
put this in a batch file, it would remove an error source from my
current workflow.
If the export could be limited to a certain date-range (like the existing GUI export), export date-format (unix vs. windows time format) and export delimiter (commas vs. tabs) that would be the icing on the cake. But I'll settle for any export right now.
Having the stuff printed to the terminal would be good enough, because writing it into a file is fairly easy (the "> mt_tags.csv" part), and as a plus you could also just process it in another script without an intermediary file.
-
Times are in local time and the report should honor the timeshift setting. There is a bug in the current beta, some wrong activities when you use timeshift, we will fix it next week.
-
astrid commented
Awesome!
Documentation might need a tiny dash of clarification in my opinion:
The from date and to date don't specify if they are timezone aware, DST-Aware and if they also perhaps honor the day start shift setting. -
optroot commented
I'd like to see something like this too. Even if we could just export tags/application csv etc. on a schedule, just like the db.
-
Claudius commented
A more elaborate command line (with all the configuration options) would look something like this:
> ManicTime.exe --export="Tags" --from="2015-10-01T00:00:00+02:00" --until="2015-10-31T23:59:59+02:00" --delimiter="," --timestamps="unix" > mt_tags.csv
I also don't have a very strong preference for unix-style options (--export) vs windows style options (/export), I just wrote down what came to my mind.