Created
April 23, 2018 02:44
-
-
Save tell/9519afc6165023d58aba9f89656046c8 to your computer and use it in GitHub Desktop.
Convert NTL Matrix to JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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