Skip to content

Instantly share code, notes, and snippets.

@tell
Created April 23, 2018 02:44
Show Gist options
  • Save tell/9519afc6165023d58aba9f89656046c8 to your computer and use it in GitHub Desktop.
Save tell/9519afc6165023d58aba9f89656046c8 to your computer and use it in GitHub Desktop.
Convert NTL Matrix to JSON
#!/usr/bin/env bash
# vim: set expandtab :
# Convert NTL Matrix to JSON.
cat - \
| tr "\n" " " \
| sed -e 's/ \]/\]/g' \
-e 's/ *$//g' \
-e 's/ /,/g' \
| sed -e 's/^/\{"matrix":/' \
-e 's/$/\}/'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment