Skip to content

Instantly share code, notes, and snippets.

@bigwheel
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bigwheel/ba54d09e9276426a03ce to your computer and use it in GitHub Desktop.
Save bigwheel/ba54d09e9276426a03ce to your computer and use it in GitHub Desktop.
# play-jsonからhoconフォーマットへだいたい変換するスクリプト
# Seqだけはカッコが同一行へ存在しないと変換を失敗する
sed -i -e 's/Json.obj(/{/g' $1
sed -i -e 's/ -> /: /g' $1
sed -i -e 's/,$//g' $1
sed -i -e 's/Seq(\(.*\))/[\1]/g' $1
sed -i -e 's/L$//g' $1
sed -i -e 's/)/}/g' $1
sed -i -e 's/^\(\s*\)"\([^"]*\)"/\1\2/g' $1
sed -i -e 's/JsNull/null/g' $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment