POKI_PUT_TOC_HERE

As discussed in the section on POKI_PUT_LINK_FOR_PAGE(file-formats.html)HERE, Miller supports several different file formats. Different tools are good at different things, so it’s important to be able to move data into and out of other languages. CSV and JSON are well-known, of course; here are some examples using DKVP format, with Ruby and Python.

DKVP I/O in Python

Here are the I/O routines: POKI_INCLUDE_ESCAPED(polyglot-dkvp-io/dkvp_io.py)HERE And here is an example using them: POKI_RUN_COMMAND{{cat polyglot-dkvp-io/example.py}}HERE Run as-is: POKI_RUN_COMMAND{{python polyglot-dkvp-io/example.py < data/small}}HERE Run as-is, then pipe to Miller for pretty-printing: POKI_RUN_COMMAND{{python polyglot-dkvp-io/example.py < data/small | mlr --opprint cat}}HERE

DKVP I/O in Ruby

Here are the I/O routines: POKI_INCLUDE_ESCAPED(polyglot-dkvp-io/dkvp_io.rb)HERE And here is an example using them: POKI_RUN_COMMAND{{cat polyglot-dkvp-io/example.rb}}HERE Run as-is: POKI_RUN_COMMAND{{ruby -I./polyglot-dkvp-io polyglot-dkvp-io/example.rb data/small}}HERE Run as-is, then pipe to Miller for pretty-printing: POKI_RUN_COMMAND{{ruby -I./polyglot-dkvp-io polyglot-dkvp-io/example.rb data/small | mlr --opprint cat}}HERE

SQL-output examples

Please see here.

SQL-input examples

Please see here.