From fe6dd89900fd93c507bf93aaa423bd2eeec35831 Mon Sep 17 00:00:00 2001 From: LarsVomMars Date: Mon, 12 Oct 2020 17:38:07 +0200 Subject: json to csv parser --- parse.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 parse.py (limited to 'parse.py') diff --git a/parse.py b/parse.py new file mode 100644 index 0000000..7181d00 --- /dev/null +++ b/parse.py @@ -0,0 +1,11 @@ +import json + +users = json.loads(open("./users.json", "r").read()) + +for cid in users: + clazz = users[cid] + s = "Nutzername,Password" + for user in clazz: + s += f"\n{user['username']},{user['pwd']}" + + open(f"./{cid}.csv", "w").write(s) -- cgit v1.2.3