Skip to content

Instantly share code, notes, and snippets.

@graysonarts
Created October 26, 2014 02:13
Show Gist options
  • Save graysonarts/6ab2dde3b31e2234976b to your computer and use it in GitHub Desktop.
Save graysonarts/6ab2dde3b31e2234976b to your computer and use it in GitHub Desktop.
ZSH script to use of-store to export CSV files for loading into Tableau
#!/usr/bin/env zsh
BASE=${0%/*}
SQLITE=/usr/bin/sqlite3
echo "Extracting from OmniFocus"
$BASE/of-store --debug --out=$BASE/finished.db
echo "Exporting to tasks.csv"
$SQLITE $BASE/finished.db <<!
.headers on
.mode csv
.output tasks.csv
select * from tasks;
!
echo "Exporting to projects.csv"
$SQLITE $BASE/finished.db <<!
.headers on
.mode csv
.output projects.csv
select * from projects;
!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment