Alright, I’m reading data from a text file and converting to tables and data. It’s becoming too complicated and need help simplifying. I’ve been using string.Explode() thus far and it’s getting a bit too confusing.
Here’s an example text file:
"Main";"Title"="123","Title2"="345"-
"Main2";"LOL"="012","LOL2"="333"-
"Main3";"whatever"="01","whatever2"="93"
Here’s how this is formatted:
[ul]
[li]The “;” separates the Main from the data.
[/li][li]The “=” separates the Title from the number data.
[/li][li]The “,” separates the Titles/Number data from one another.
[/li][li]The “-” separates the Mains from one another.
[/li][/ul]
Here’s how I want it to turn out:
[lua]
mytable[“Stuff”][“Main”].Data[“Title”] = “123”
mytable[“Stuff”][“Main”].Data[“Title2”] = “345”
mytable[“Stuff”][“Main2”].Data[“LOL”] = “012”
mytable[“Stuff”][“Main2”].Data[“LOL2”] = “333”
mytable[“Stuff”][“Main3”].Data[“whatever”] = “01”
mytable[“Stuff”][“Main3”].Data[“whatever2”] = “93”
[/lua]
You get the idea.
The thing is that I want to be able to access the “Main”, “Title”, and Number data when it’s all said and done with. I don’t even want to show my code because it’s an utter mess at this point. I either need someone to show me how to do this right, or show me a better way of doing it all together.