I want the sed equivalent of this line of vim:
:s/","/",^M"/g
The goal: Take a line that contains a massive json block, and break it up into individual lines.
An example of what I want to work with is http://www.cartoonnetwork.com/video/teen-titans-go/episodes/index.html (look for function getFullEpisodes()).
What I tried:
519 sed -e 's/","/",\n"/g' < /tmp/url > /tmp/line-url
-- did not work, just put "n" at the proper place.
521 sed -e 's/","/",\\n"/g' < /tmp/url > /tmp/line-url
-- did not work, put a backslash followed by n at the proper place.
The full "script" of vim commands that I want to turn into a shell script:
:s/","/",^M"/g
:1,$!grep seo
:g,^.*/vid,s,,http://www.cartoonnetwork.com/vid
:g/"},{.*/s///
:$s,"}];,,
:wn
cat foo.json | python -m json.tool
orcat foo.json | jq '.'