We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem Statement
Sometimes I need to modify an xml file from the script. I could use sed but IMO it is error prone as it does not understand xml structure.
sed
jq supports modifying values as follows:
jq
$ curl https://dummyjson.com/products/1 | jq '.id=2' { "id": 2, # this was originally 1 "title": "iPhone 9", "description": "An apple mobile which is nothing like apple", "price": 549, "discountPercentage": 12.96, "rating": 4.69, "stock": 94, "brand": "Apple", "category": "smartphones", "thumbnail": "https://i.dummyjson.com/data/products/1/thumbnail.jpg", "images": [ "https://i.dummyjson.com/data/products/1/1.jpg", "https://i.dummyjson.com/data/products/1/2.jpg", "https://i.dummyjson.com/data/products/1/3.jpg", "https://i.dummyjson.com/data/products/1/4.jpg", "https://i.dummyjson.com/data/products/1/thumbnail.jpg" ] }
It would be great to have the same provided by xq.
xq
The text was updated successfully, but these errors were encountered:
sibprogrammer
No branches or pull requests
Problem Statement
Sometimes I need to modify an xml file from the script. I could use
sed
but IMO it is error prone as it does not understand xml structure.jq
supports modifying values as follows:It would be great to have the same provided by
xq
.The text was updated successfully, but these errors were encountered: