Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
neil3d committed Dec 15, 2017
1 parent b2dd566 commit f2a18b3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 38 deletions.
Binary file modified Docs/ExampleData.xlsx
Binary file not shown.
2 changes: 1 addition & 1 deletion GUI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ private void panelExcelDropBox_DragDrop(object sender, DragEventArgs e) {
/// 显示Help文档
/// </summary>
private void btnHelp_Click(object sender, EventArgs e) {
System.Diagnostics.Process.Start("http://neil3d.github.io");
System.Diagnostics.Process.Start("https://neil3d.github.io/app/excel2json.html");
}

/// <summary>
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("https://neil3d.github.io")]
[assembly: AssemblyProduct("excel2json")]
[assembly: AssemblyCopyright("https://neil3d.github.io")]
[assembly: AssemblyCopyright("https://neil3d.github.io/app/excel2json.html")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
37 changes: 1 addition & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,4 @@
excel2json
==========

![](./cmd.png)

- 把Excel表单转换成json对象,并保存到一个文本文件中。
- 表格格式见:ExampleData.xlsx
- 支持导出为数组 Json格式,每一行转换为数组的一行,[结构如下](./ExampleDataExportArray.json)
[
{行内容},
{行内容},
{...},
]
- 支持导出为Dictionary Json对象, 每一行转换成一个json对象。[结构如下](./ExampleDataExportDict.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 --array true**,其中的输入和输出文件,都在当前目录下;
详细帮助文档请见:[https://neil3d.github.io/app/excel2json.html](https://neil3d.github.io/app/excel2json.html)

0 comments on commit f2a18b3

Please sign in to comment.