In the game project is generally required by the planning to create a large number of game content, a large part of the use of Excel table to make. The program then needs to convert the Excel file into a format that the program can read easily.
The Excel table Import tool that was used by the previous project was a very frustrating and inefficient use of Office Excel components for data access. An end-trip project generally to hundreds of forms, hand-tour items 20, 30 tables are basically also to be, so the process of the form Import program usually take a few minutes, the project to close to half an hour later.
This shared gadget, which has a qualitative leap in speed, is nearly 100 times times faster than the tools achieved above:
- Full project source code download: Https://github.com/neil3d/excel2json
- The main function is: Convert the Exce l form to a JSON object and save it to a text file
- Using the command line, it is convenient to write multiple table conversion work as a batch file, once executed.
The reason why this is so much more efficient is not how high the blogger's programming level is, but the addition of an open source project: Https://github.com/ExcelDataReader/ExcelDataReader This library does not use Office components, Instead of reading the file directly, parsing its contents, bypassing the complex component mechanism, the data conversion process, so quickly. This is mainly the benefit of the OPENXML standard.
By the way, the Excel xlsx file is actually a standard zip file, as shown in. After extracting it, the XML file can be parsed according to the OPENXML standard. :)
Share a gadget: Excel tables quickly convert to JSON strings