Nerox. Posted February 7, 2017 Share Posted February 7, 2017 I have a normal .txt file, that file includes a lot of info in that format [[Event name: Blbabalba] [Event date: mm/dd/yy] [Event Desc: blalbal] 1. blablalbalblabla (blabalbal).... ......5.bblablablal ] [Event name: blalblalba2] [Event date: mm/dd/yy 2] ........etc, you get the idea There is more than 300 of these portions and they are all after each other, I know I can use string.sub to cut the string but how to identify where to start from and where to end, I want to process this automatically so the scripts get every event part and store this string in a table. see these 2 [ ] ? these aren't in the string I just put them so you understand that what's inside of them is the part which should be cut for each event part How to do this, and Thanks in advance Link to comment
Bonsai Posted February 7, 2017 Share Posted February 7, 2017 Maybe you should just save it as JSON instead. Link to comment
Nerox. Posted February 7, 2017 Author Share Posted February 7, 2017 Well I will but first I have to convert current file to json so I have to get each event info and store it in a lua table then convert them to whatever format I want json, sql, etc.. So how to retrieve each portion of the string ? Link to comment
nikitafloy Posted February 7, 2017 Share Posted February 7, 2017 1 hour ago, Nerox. said: Well I will but first I have to convert current file to json so I have to get each event info and store it in a lua table then convert them to whatever format I want json, sql, etc.. So how to retrieve each portion of the string ? try to export in table Link to comment
nikitafloy Posted February 7, 2017 Share Posted February 7, 2017 (edited) del Edited February 7, 2017 by nikitafloy Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now