Apply templates at the row level

``` glaze json misc/test-data/[123].json --template '{{.a}}-{{.b}}: {{.d_f}}' \ --use-row-templates --fields a,_0 \ --output csv ```

Sections

Terminology & Glossary
📖 Documentation
Navigation
74 sectionsv0.1
📄 Apply templates at the row level — glaze help templates-row-level
templates-row-level

Apply templates at the row level

``` glaze json misc/test-data/[123].json --template '{{.a}}-{{.b}}: {{.d_f}}' \ --use-row-templates --fields a,_0 \ --output csv ```

Exampletemplatesjsonyamltemplateuse-row-templates

You can also apply templates at the row level, once the input has been flattened. In this case, because flattened columns contain the symbol ., fields get renamed to use the symbol _ as a separator.

The new column is output alongside all the other columns.

❯ glaze json misc/test-data/[123].json --template '{{.a}}-{{.b}}: {{.d_f}}' \
  --use-row-templates --fields a,_0 \
  --output csv
a,_0
1,1-2: 7
10,10-20: 70
100,100-200: <no value>