1

I concatenated a lot of json files into another file.

This means there's lots of json (all on one line) that isn't valid, e.g.

{"foo":"bar"}{"extra":["stuff"]}

I want to replace the }{ with },\n{, so running on the above file would produce

{"foo":"bar"},
{"extra":"stuff"}

I tried

sed 's/}{/},\n{/g' items.json

It doesn't put the newline, only ,n

theonlygusti
  • 11,032
  • 11
  • 64
  • 119

0 Answers0