isau
Deity
- Joined
- Jan 15, 2007
- Messages
- 3,071
I just had to convert a bunch of code from XML to SQL for a conversion project, and after converting a bunch of it by hand, decided there had to be a better a way to do the conversion. I figured one out using SQLite Studio. Whether it is hard or easy will depend on how hard it is to find the data in the tables. There may be other ways to do this, but this is how I've been approaching it.
To do the conversion:
To do the conversion:
- Put the XML you want to convert into a mod. (The XML much actually function for this to work--you can't convert bad code).
- Load the mod. Wait til you get past the loading screen.
- In SQLite, go to the table the XML wrote to. Right click it and select Edit table.
4. Select the Data tab at the top to see a list of the Data in the table.
5. In the Data fields, select the range of cells you want to convert.
6. Right click and select Generate query for selected cells > INSERT.
7. A window will load with your results. Copy and paste them into your mod.
There are a LOT of additional uses for this BTW. You can actually use it to free-design new Units, Buildings, and so on, right click, and create an instant INSERT (or UPDATE) statement. You can also use it for generating quick SELECT statements.
5. In the Data fields, select the range of cells you want to convert.
6. Right click and select Generate query for selected cells > INSERT.
7. A window will load with your results. Copy and paste them into your mod.
There are a LOT of additional uses for this BTW. You can actually use it to free-design new Units, Buildings, and so on, right click, and create an instant INSERT (or UPDATE) statement. You can also use it for generating quick SELECT statements.