hw-1

convert yaml to json

convert yaml to json / parse json by command

1
2
3
4
5
6
7
8
//install jq
sudo port install jq
//sudo port install py27-yaml
sudo python -m easy_install pyyaml
//parse json by command
cat jsonfile |jq '.list[0].name'
//convert yaml to json
python -c 'import sys, yaml, json; json.dump(yaml.load(sys.stdin), sys.stdout, indent=4)' < file.yaml > file.json