From c5a45ba7d5e7154e6015086c3af4501e7f1c90f5 Mon Sep 17 00:00:00 2001 From: Mike Farah Date: Mon, 7 May 2018 16:26:02 +1000 Subject: [PATCH] Removed dud instructions --- docs/read/index.html | 25 ------------------------- docs/search/search_index.json | 7 +------ mkdocs/read.md | 12 ------------ 3 files changed, 1 insertion(+), 43 deletions(-) diff --git a/docs/read/index.html b/docs/read/index.html index 7f7e1024..8e3f446b 100644 --- a/docs/read/index.html +++ b/docs/read/index.html @@ -256,13 +256,6 @@ Splat - - -
  • - - Handling '.' in the yaml key - -
  • @@ -380,13 +373,6 @@ Splat -
  • - -
  • - - Handling '.' in the yaml key - -
  • @@ -469,17 +455,6 @@ bob: - apples -

    Handling '.' in the yaml key

    -

    Given a sample.yaml file of:

    -
    b.x:
    -  c: 2
    -
    - -

    then

    -
    yq r sample.yaml \"b.x\".c
    -
    - -

    will output the value of '2'.

    Arrays

    You can give an index to access a specific element: e.g.: given a sample file of

    diff --git a/docs/search/search_index.json b/docs/search/search_index.json index c4ad8b15..4ce506ee 100644 --- a/docs/search/search_index.json +++ b/docs/search/search_index.json @@ -17,7 +17,7 @@ }, { "location": "/read/", - "text": "yq r \n\n\n\n\nThis command can take a json file as input too, and will output yaml unless specified to export as json (-j)\n\n\nBasic\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq r sample.yaml b.c\n\n\n\n\nwill output the value of '2'.\n\n\nFrom Stdin\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\ncat sample.yaml | yq r - b.c\n\n\n\n\nwill output the value of '2'.\n\n\nSplat\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\n---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples\n\n\n\n\nthen\n\n\nyq r sample.yaml bob.*.cats\n\n\n\n\nwill output\n\n\n- bananas\n- apples\n\n\n\n\nHandling '.' in the yaml key\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb.x:\n c: 2\n\n\n\n\nthen\n\n\nyq r sample.yaml \\\"b.x\\\".c\n\n\n\n\nwill output the value of '2'.\n\n\nArrays\n\u00b6\n\n\nYou can give an index to access a specific element:\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[1].name'\n\n\n\n\nwill output 'sam'\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nArray Splat\n\u00b6\n\n\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[*].name'\n\n\n\n\nwill output:\n\n\n- fred\n- sam\n\n\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.", + "text": "yq r \n\n\n\n\nThis command can take a json file as input too, and will output yaml unless specified to export as json (-j)\n\n\nBasic\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\nb:\n c: 2\n\n\n\n\nthen\n\n\nyq r sample.yaml b.c\n\n\n\n\nwill output the value of '2'.\n\n\nFrom Stdin\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\ncat sample.yaml | yq r - b.c\n\n\n\n\nwill output the value of '2'.\n\n\nSplat\n\u00b6\n\n\nGiven a sample.yaml file of:\n\n\n---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples\n\n\n\n\nthen\n\n\nyq r sample.yaml bob.*.cats\n\n\n\n\nwill output\n\n\n- bananas\n- apples\n\n\n\n\nArrays\n\u00b6\n\n\nYou can give an index to access a specific element:\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[1].name'\n\n\n\n\nwill output 'sam'\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nArray Splat\n\u00b6\n\n\ne.g.: given a sample file of\n\n\nb:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4\n\n\n\n\nthen\n\n\nyq r sample.yaml 'b.e[*].name'\n\n\n\n\nwill output:\n\n\n- fred\n- sam\n\n\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.\n\n\nKeys with dots\n\u00b6\n\n\nWhen specifying a key that has a dot use key lookup indicator.\n\n\nb:\n foo.bar: 7\n\n\n\n\nyaml r sample.yaml 'b[foo.bar]'\n\n\n\n\nyaml w sample.yaml 'b[foo.bar]' 9\n\n\n\n\nAny valid yaml key can be specified as part of a key lookup.\n\n\nNote that the path is in quotes to avoid the square brackets being interpreted by your shell.", "title": "Read" }, { @@ -35,11 +35,6 @@ "text": "Given a sample.yaml file of: ---\nbob:\n item1:\n cats: bananas\n item2:\n cats: apples then yq r sample.yaml bob.*.cats will output - bananas\n- apples", "title": "Splat" }, - { - "location": "/read/#handling-in-the-yaml-key", - "text": "Given a sample.yaml file of: b.x:\n c: 2 then yq r sample.yaml \\\"b.x\\\".c will output the value of '2'.", - "title": "Handling '.' in the yaml key" - }, { "location": "/read/#arrays", "text": "You can give an index to access a specific element:\ne.g.: given a sample file of b:\n e:\n - name: fred\n value: 3\n - name: sam\n value: 4 then yq r sample.yaml 'b.e[1].name' will output 'sam' Note that the path is in quotes to avoid the square brackets being interpreted by your shell.", diff --git a/mkdocs/read.md b/mkdocs/read.md index 27a8d9a7..e7c339a1 100644 --- a/mkdocs/read.md +++ b/mkdocs/read.md @@ -43,18 +43,6 @@ will output - apples ``` -### Handling '.' in the yaml key -Given a sample.yaml file of: -```yaml -b.x: - c: 2 -``` -then -```bash -yq r sample.yaml \"b.x\".c -``` -will output the value of '2'. - ### Arrays You can give an index to access a specific element: e.g.: given a sample file of