Json

From Hackepedia
Revision as of 06:57, 4 February 2011 by Franks (talk | contribs) (Created page with "I was getting json output that had no newlines, so was difficult to parse/filter. I ended up doing the following: cat json.output | sed -e 's/[{}]/'\\n'/g' | awk -F, '{print $...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

I was getting json output that had no newlines, so was difficult to parse/filter. I ended up doing the following:

cat json.output | sed -e 's/[{}]/'\\n'/g' | awk -F, '{print $2}'

which removed the {}'s and replaced them with newlines. This made it easier to grep/awk.