Skip to content

Instantly share code, notes, and snippets.

@joyrexus
Last active March 3, 2016 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save joyrexus/6021824 to your computer and use it in GitHub Desktop.
Save joyrexus/6021824 to your computer and use it in GitHub Desktop.
Dump an LDP transcript from the sqlite datastore

Dump an LDP transcript

Suppose you want to dump a few columns from the transcript for seventh visit to subject 22 in our study ... say the columns containing for both parent and child utterances) to view them in Excel or Google Docs:

LDP_DB=$LDP/data/ldp.db

sqlite3 -header -separator "<TAB>" $LDP_DB 'SELECT id, time, p_utts, c_utts FROM utterances WHERE session=7 AND subject=22' > 22.07.xls

To insert a tab character type CONTROL + V then T. (That is, hold down the control key with the V key, followed by T.)

Alternatively, create a file named .sqliterc in your home directory (~/.sqliterc) and add the following lines:

.mode list
.header ON
.separator "\t"

Then you can just use the following:

sqlite3 $LDP_DB 'SELECT id, time, p_utts, c_utts FROM utterances WHERE session=7 AND subject=22' > 22.07.xls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment