Json2json bash script

Rationale: service returns many independent RDF records. Script puts them in a common JSON array.

#!/bin/bash
# Jovanovic, 2013-01
# usage: ./json2json.sh ime
# read arguments from command line, 
# reformat the JSON for processing, write JSON file
 
perl -0777 -wpl -e 's/^/\[/;' $1-json \
| perl -0777 -wpl -e 's/,\n*$/\n\]\n/;' > $1.json
 
z/json2json.sh.txt · Last modified: 20. 01. 2013. 00:45 by njovanov
 
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki