1 Star 2 Fork 3

keyle_xiao / excel2json

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

excel2json

  • 把Excel表单转换成json对象,并保存到一个文本文件中。
  • 表格格式见ExampleData.xlsx
  • 导出的json对象的结构如下,每一行转换成一个json对象: { ID:{...} ID:{...} ID:{...} ... }

Excel表单格式约定

  • 第一行固定作为列名(用来构造json字段名称);
  • 第一列固定作为对象的ID;
  • 读取Excel Workbook中的第一个sheet;
  • 对于SQL导出模式:第二行固定为字段类型
  • 使用表头生成C#数据定义代码

命令行参数

  • -e, --excel Required. 输入的Excel文件路径.
  • -j, --json 指定输出的json文件路径.
  • -s, --sql 指定输出的SQL文件路径.
  • -p, --csharp 指定输出的C#数据定义代码文件路径.
  • -h, --header Required. 表格中有几行是表头.
  • -c, --encoding (Default: utf8-nobom) 指定编码的名称.
  • -l, --lowcase (Default: false) 自动把字段名称转换成小写格式.

例如:“excel2json --excel test.xlsx --json test.json --header 3”,其中的输入和输出文件,都在当前目录下;

The MIT License (MIT) Copyright (c) 2014 Neil Fang Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

把Excel表单转换成json对象,并保存到一个文本文件中,并支持生成C# class数据定义代码。 展开 收起
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/keyle/excel2json.git
git@gitee.com:keyle/excel2json.git
keyle
excel2json
excel2json
master

搜索帮助