Skip to content

Instantly share code, notes, and snippets.

@tejasmanohar
Created August 7, 2017 04:35
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 tejasmanohar/a8884d3fd583830507481bea5c0dbfed to your computer and use it in GitHub Desktop.
Save tejasmanohar/a8884d3fd583830507481bea5c0dbfed to your computer and use it in GitHub Desktop.
stdin of new-line separated (presumably json) objects to array (for jq)
import fileinput
out = []
for line in fileinput.input():
out.append(line.rstrip())
print('[')
print(',\n'.join(out))
print(']')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment