1

I have a json file that it has more than 30k lines, and I need to replace all instances of }{ in the file with },{ by using script shell or just a text editor like less or vim.

terdon
  • 104,119
HISI
  • 231

1 Answers1

3

Just use sed:

sed 's/}{/},{/g' orig.json > new.json

Or, to edit the file in place (this will copy the original to orig.json.bak):

sed -i.bak 's/}{/},{/g' orig.json
dessert
  • 40,956
terdon
  • 104,119