From 6e29d7184e564bc3926a1a6fefd4037099b45378 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Sun, 12 Jan 2014 21:41:09 +0100 Subject: Use jshon as tidier (jq only in unstable), and split to try not loose content if parsing fails. --- localtidygeojson | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/localtidygeojson b/localtidygeojson index 49f8c6e..5e9e3c6 100755 --- a/localtidygeojson +++ b/localtidygeojson @@ -16,8 +16,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . # -# Depends: jq moreutils +# Depends: jshon moreutils set -eu -jq . "$1" | perl -0 -pe 's/ /\t/g; s/},\s*{/}, {/g; s/\[\s*([\d.,]+)\s*([\d.]+)\s*\]/[$1 $2]/g' | sponge "$1" +jshon -SIF "$1" +perl -0 -i -pe 's/},\s*{/}, {/g; s/\[\s*([\d.,]+)\s*([\d.]+)\s*\]/[$1 $2]/g' "$1" -- cgit v1.2.3