准备好1.xlsx表格文件,工作薄为cbd:
列名为:
{"客户名称", "品名", "颜色", "规格", "订单号", "消费者", "联系方式", "交货日期", "审核日期"}
创建好数据库excel
用法:go run main.go 1.xlsx cbd
/** * Author:飘~ * 407787759@qq.com * Date:2019/7/15 * Description: */ package main import ( "bufio" "fmt" "github.com/astaxie/beego/orm" _ "github.com/go-sql-driver/mysql" "github.com/tealeg/xlsx" "log" "os" ) type Msg struct { Id int Khmc string Pm string Ys string Gg string Ddh string Xfz string Lxfs string Jhrq string Shrq string } func init() { orm.RegisterDriver("mysql", orm.DRMySQL) orm.RegisterDataBase("default", "mysql", "root:root@tcp(127.0.0.1:3306)/excel?charset=utf8", 30) o