Created
September 6, 2018 14:13
-
-
Save alexlovelltroy/5acf425dbd86ac13140d3e07ebcd262e to your computer and use it in GitHub Desktop.
Given a son file, reformat it as one data element per line
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 python3 | |
import json | |
import sys | |
if __name__ == "__main__": | |
program_name = sys.argv[0] | |
arguments = sys.argv[1:] | |
count = len(arguments) | |
filename = arguments[0] | |
with open(filename, 'r') as f: | |
members_dict = json.load(f) | |
with open(filename + "l", 'w', encoding='utf-8') as g: | |
for member in members_dict: | |
g.write(json.dumps(member)+'\n') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment