C
C#2y ago
LukeZurg22

Deserializing Given Text File Into JSON

Good evening, I've spent weeks trying to get the data out of this text file into a proper set of variables to use within my program. So far i've no luck, and my best attempt was to manually read and parse every individual line with a tedious set of boolean checks. Any possible ways I could better parse this file?
6 Replies
Yawnder
Yawnder2y ago
I don't think there is no, unless the provider of that file gives you instructions or a library to handle that.
LukeZurg22
LukeZurg222y ago
Sadly, no.
Kouhai
Kouhai2y ago
The file structure doesn't look that complicated Assuming # lines are comments You can use a simple regex expression like this to get both the key/tag and the file path ^([\w]{3}).*"(.*)"
Kouhai
Kouhai2y ago
regex101
regex101: build, test, and debug regex
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET.
ero
ero2y ago
New formats? This is just ini Which does have libraries to deserialize
LukeZurg22
LukeZurg222y ago
I’ll check it out, thank you. By tonight Ill see if I can’t get back to you. I also may have sent the wrong file by mistake! I just noticed Smadgehttps://cdn.discordapp.com/attachments/787470009710018620/1031015013491683338/cultures.txt This should be it
Want results from more Discord servers?
Add your server
More Posts