skip to Main Content

xidel: how to retrieve value from JSON key containing dots(.)?

I try to retrieve 1 in : $ cat object.json { "apiVersion": "apps/v1", "kind": "Deployment", "metadata": { "annotations": { "deployment.kubernetes.io/revision": "1" } } } $ xidel -e '($json).metadata.annotations["deployment.kubernetes.io/revision"]' -s object.json { "deployment.kubernetes.io/revision": "1" } Tried '($json).metadata.annotations."deployment.kubernetes.io/revision"' '($json).metadata.annotations.("deployment.kubernetes.io/revision")' '($json).metadata.annotations.(deployment.kubernetes.io/revision)'

VIEW QUESTION

Xidel extract number/float – Woocommerce

I would like to extract number/float value from this code using Xidel: <p class="price"> <span class="woocommerce-Price-amount amount"> <bdi> 304.00 <span class="woocommerce-Price-currencySymbol"> € </span> </bdi> </span> </p> I am trying the following command: xidel -s '<p class="price"><span class="woocommerce-Price-amount amount"><bdi>304.00 <span class="woocommerce-Price-currencySymbol">€</span></bdi></span></p>' -e…

VIEW QUESTION
Back To Top
Search