Just a cookbook about how to get a YAML file when you have a JSON one.
python -c 'import sys, yaml, json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < file.json > file.yaml
Just a cookbook about how to get a YAML file when you have a JSON one.
python -c 'import sys, yaml, json; yaml.safe_dump(json.load(sys.stdin), sys.stdout, default_flow_style=False)' < file.json > file.yaml
Reading time: < 1 minute
Petit trick per convertir un fitxer XML a un fitxer YAML (yml) amb Perl, fan falta les llibreries pertinents de perl.
perl -MYAML -MXML::Simple -e 'print Dump XMLin "fixer.xml"'