Share a gadget: Excel tables quickly convert to JSON strings

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.