Rename columns using a YAML file

``` glaze yaml misc/test-data/test.yaml --input-is-array \ --rename-yaml misc/rename.yaml ```

Sections

Terminology & Glossary
📖 Documentation
Navigation
77 sectionsv0.1
📄 Rename columns using a YAML file — glaze help rename-yaml
rename-yaml

Rename columns using a YAML file

``` glaze yaml misc/test-data/test.yaml --input-is-array \ --rename-yaml misc/rename.yaml ```

Examplerenameyamljsonrename-yaml

You can specify how to rename column using a YAML file that has the following format:

renames:
  oldColumnName: newColumnName
  otherColumnName: anotherNewColumName
regexpRenames:
  "^foo(.*}": "${1}_replacement"

The same rules as for the --rename and --rename-regexp flags apply.


❯ cat misc/rename.yaml                                    
renames:
  foo: bar
regexpRenames:
  "^bar
quot;: "baz" ".(o.b).": ""% ❯ glaze yaml misc/test-data/test.yaml --input-is-array \ --rename-yaml misc/rename.yaml +-----+-----+-----+-----+---------+ | bar | baz | d.e | d.f | oobr | +-----+-----+-----+-----+---------+ | 1 | 7 | 6 | 7 | [3 4 5] | | 10 | 70 | 60 | 70 | | | | | | | [300] | +-----+-----+-----+-----+---------+