示例#1
0
func NewCsvTable(file string) *CsvTable {
	table := new(CsvTable)
	bt := new(msdb.BaseTable)
	table.BaseTable = bt

	csv := mcsv.NewCSV(file)
	table.BaseTable.Header = csv.GetHeaderRow()
	table.body = csv.GetData()
	table.BaseTable.Cusor = new(msdb.Cusor)
	table.BaseTable.Cusor.MaxIndex = len(table.body)

	table.StringGetter = table

	return table
}
示例#2
0
文件: main.go 项目: mabetle/mcsv
func DemoRead() {
	csv := mcsv.NewCSV(csvFile)
	csv.ShowContent()
}