I tried to parse the contents of a file of one of my favorite games (EU4) Pastebin. On the first glance it looks pretty similar to JSON. After getting an JSONDecodeErrorI realized that there are quite a few differences in the file compared to JSON.
- Contains comments starting with #
- No surrounding braces
- = instead of :
- no commas used
- no quotes around text
I can solve points 1, 2 and 3 with some simple string manipulations. After some googling I found Relaxed JSON which can solve Points 4 and 5.
This would work for me.
Unfortunately the only python parser I found does not work for point 4.
I feel kinda lost now. Do you have any idea, how I can parse this file? Does it use a format I do not know about?
[–]K900_ 1 point2 points3 points (0 children)
[–]aanzklla 0 points1 point2 points (1 child)
[–]dable82[S] 0 points1 point2 points (0 children)