Created
August 7, 2017 04:35
-
-
Save tejasmanohar/a8884d3fd583830507481bea5c0dbfed to your computer and use it in GitHub Desktop.
stdin of new-line separated (presumably json) objects to array (for jq)
This file contains hidden or 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
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