excel2json

package module
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 9 Imported by: 0

README

go语言版的excel2json

go语言的高性能,而且支持跨平台

go语言版本的excel2json,可以把excel表转换成json文件

使用方法: 在命令行中使用,输入

cxcel2json -help

运行结果,可查询运行参数

  -e string
        Required. 输入的Excel文件路径
  -h int
        表格中有几行是表头. (default 3)
  -j string
        指定输出的json文件路径
  -k int
        key值在第几行 (default 1)
  -s string
        excel表的页签名称 (default "data")

如果需要转一个excel表比如 item.xlxs 表

excel2json -e item.xlxs -j item.json

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Excel

func Excel(file string, jsonDir string, header int, key int, sheet string)

Excel 将Excel文件转换为JSON格式

@Description: 此函数用于读取指定的Excel文件,根据提供的表头位置、关键行索引和工作表名称,将数据转换为JSON格式,并保存到指定的目录下。 @param file string - Excel文件的路径。 @param jsonDir string - 生成的JSON文件将保存在该目录下。如果未指定,将与Excel文件同名但扩展名为.json。 @param header int - 表头所在的行索引(从0开始)。 @param key int - 包含列名的关键行索引(从0开始)。 @param sheet string - Excel工作表的名称。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL