1 Star 0 Fork 2

wwwlib/excel2json

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Program.Options.cs 1.89 KB
一键复制 编辑 原始数据 按行查看 历史
neil3d 提交于 2019-02-03 14:14 . gui date format
using System;
using CommandLine;
using CommandLine.Text;
namespace excel2json {
partial class Program {
/// <summary>
/// 命令行参数定义
/// </summary>
internal sealed class Options {
public Options() {
this.HeaderRows = 3;
this.Encoding = "utf8-nobom";
this.Lowcase = false;
this.ExportArray = false;
}
[Option('e', "excel", Required = true, HelpText = "input excel file path.")]
public string ExcelPath {
get;
set;
}
[Option('j', "json", Required = false, HelpText = "export json file path.")]
public string JsonPath {
get;
set;
}
[Option('h', "header", Required = false, DefaultValue = 1, HelpText = "number lines in sheet as header.")]
public int HeaderRows {
get;
set;
}
[Option('c', "encoding", Required = false, DefaultValue = "utf8-nobom", HelpText = "export file encoding.")]
public string Encoding {
get;
set;
}
[Option('l', "lowcase", Required = false, DefaultValue = false, HelpText = "convert filed name to lowcase.")]
public bool Lowcase {
get;
set;
}
[Option('a', "array", Required = false, DefaultValue = false, HelpText = "export as array, otherwise as dict object.")]
public bool ExportArray {
get;
set;
}
[Option('d', "date", Required = false, DefaultValue = "yyyy/MM/dd", HelpText = "Date Format String, example: dd / MM / yyy hh: mm:ss.")]
public string DateFormat {
get;
set;
}
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wwwlib/excel2json.git
git@gitee.com:wwwlib/excel2json.git
wwwlib
excel2json
excel2json
master

搜索帮助