json2yaml icon indicating copy to clipboard operation
json2yaml copied to clipboard

Processing file output option separate first level in yaml

Open cesarjorgemartinez opened this issue 8 years ago • 2 comments

Hi, I see your json2yaml and is a great tool. When use a big json file, and covert into a yaml file, write all in each line, the is difficult read without a separator. An example is: test1: ...... ...... test2: ...... ...... .....

Exist a option or workaround to generate the first level with a empty line? Example: test1: ...... ......

test2: ...... ......

.....

Regards

cesarjorgemartinez avatar Mar 07 '17 17:03 cesarjorgemartinez

This should be possible. It'll be a couple of days before I have a chance to work on it though.

drbild avatar Mar 08 '17 15:03 drbild

A provisional workaround, test if work: cat myfile.json | json2yaml | perl -0 -pe 's/(\n\s+.+\n)([^\s]+|$)/\1\n\2/gim'

cesarjorgemartinez avatar Mar 09 '17 16:03 cesarjorgemartinez