by yoduh · 14y ago · 0 comments
But... "structured data", at least in his examples (and nearly all the JSON I see on the web), is... text. Does his perl script handle binary json?
The author says: "Try doing THAT with any other CLI one-liner!"
Indeed I will, since I do not know perl. Should I learn it?
The folllowing seems to work, but I only tested it on the author's earthporn.json example
1. compile CamelCase filter called yycamel
2. compose throwaway sed oneliner to massage the text
3. pipe through unicode to ascii filter (not included)
4. pipe through yycamel
(I really do not like CamelCase, but whatever.)
cat > camel.l << eof
%%
[ ][A-Za-z] printf("%c",toupper(yytext[1]));
eof
flex -iCfa camel.l
cc lex.yy.c -static -ll -o yycamel
sed 's/\"title\": /\
/g;' earthporn.json |sed 's/[[(]/\
/g;' | sed '/^\"[a-zA-Z]/!d;s/[^a-zA-Z]/ /g;s/ */ /g' |yycamelNo comments yet.