skip to Main Content

Merge json objects into one

I'm trying to merge some json objects using jq. It seems to complicated for me ^^ I have a json which looks like this [ { "name": "test_name", "cpu": "1", "ip": "192.168.0.1", "kv_key": "test2_key", "kv_value": "test2_value", "location": "here" }, {…

VIEW QUESTION

Convert the text input file to JSON in Python

I am using python to convert the text input file to json. My Code: import json import re filename = "text.txt" text = {} pattern = re.compile(r's*([^=t]+)s*=s*(.*)') with open(filename, encoding='utf8') as file: for line in file: match = pattern.match(line.strip()) if…

VIEW QUESTION

Nginx – sort and update a docker-compose.yaml with jq

This is my docker-compose file: { "name": "movies-docker-test", "services": { "movies-rp": { "volumes": [ { "type": "volume", "source": "certs", "target": "/etc/nginx/certs", }, { "type": "bind", "source": "/home/nblanchet/jeudi_infra/kubernetes/okd/movies-docker-test/reverse-proxy/wikibase.conf.template", "target": "/etc/nginx/templates/wikibase.conf.template" } ] } } } I'd like to update this file…

VIEW QUESTION
Back To Top
Search