Skip to content

Exporting DSU entries

Gene M. Angelo, Jr edited this page Jan 5, 2024 · 4 revisions

Some ingenious soul may want to write a utility at some point, so dsu provides the means to export its data into a csv file for convenience. Of course, if you feel so inclined, you may also use the dsu entry group json files directly. The dsu entry group json files can be located by running the dsu info command, and locating the "Entries folder" value.

If you want to use a csv file, you can export dsu entries to a csv file by using any of the following commands:

  • $ dsu export all
  • $ dsu x a ## Equivalent to the above, only using shortcuts
  • $ dsu export dates OPTIONS
  • $ dsu x dd OPTIONS ## Equivalent to the above, only using shortcuts

NOTE: Each export command will prompt you to confirm the export. If confirmed, dsu will write a csv file to your operating systems temp folder, in the following format: "dsu-<timestamp>-<from date>-thru-<to date>.csv":

Where:

  • = '%Y%m%d%H%M%S'
  • = the date of the earliest entry group exported (if export all) or the earliest date of the entry group dates to be exported (if export dates).
  • = the date of the most resent entry group exported (if export all) or the most recent date of the entry group dates to be exported (if export dates).

Examples

The following command, when run on December 25, 2023, at 20:15:46...

$ dsu export dates -f 1/1/1999 -t 12/23/2023

...will export dsu entries for all Entry Groups that fall between the dates of January 1st, 1999 through December 23rd 2023 in the time zone it was executed, and write them to the following file:

/var/folders/yv/5n77gtzn7z33ytwgr9mlbbrhf5rws6/T/dsu-20231225201546-1999-01-01-thru-2023-12-23.csv

For more information, see dsu help ($ dsu export or dsu help export) for more information.