Documentation ¶
Overview ¶
package github.com/mabetle/mcsv. Very useful in import and export data between database. usage: import "github.com/mabetle/mcsv" go lang provide a csv package in encoding/csv.
Index ¶
- func BuildCsvContent(data [][]string) (r string)
- func Init()
- func WriteData(location string, data [][]string) error
- type CSV
- func (c *CSV) GetColumnNameIndex(columnName string) int
- func (c *CSV) GetColumns() int
- func (c *CSV) GetData() [][]string
- func (c *CSV) GetHeaderRow() []string
- func (c *CSV) GetRow(row int) []string
- func (c *CSV) GetRows() int
- func (c *CSV) GetString(row int, column int) string
- func (c *CSV) GetStringByColumnIndex(column int) string
- func (c *CSV) GetStringByName(columnName string) string
- func (c *CSV) Next() bool
- func (c *CSV) ShowContent()
- func (csv CSV) Write(file string)
- type RandomAccessTable
- type SimpleTable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildCsvContent ¶
Types ¶
type CSV ¶
type CSV struct {
// contains filtered or unexported fields
}
define CSV
func (*CSV) GetColumnNameIndex ¶
func (*CSV) GetStringByColumnIndex ¶
func (*CSV) GetStringByName ¶
type RandomAccessTable ¶
type RandomAccessTable struct { }
func NewRandomAccessTable ¶
func NewRandomAccessTable(file string) *RandomAccessTable
GetRandomAccessTable
func (RandomAccessTable) GetCols ¶
func (table RandomAccessTable) GetCols() int
func (RandomAccessTable) GetRows ¶
func (table RandomAccessTable) GetRows() int
type SimpleTable ¶
type SimpleTable struct {
// contains filtered or unexported fields
}
implements for sdb.SimpleTable a valid table csv file must have head in first line
func GetSimpleTable ¶
func GetSimpleTable(file string) *SimpleTable
func (*SimpleTable) GetCols ¶
func (t *SimpleTable) GetCols() int
func (*SimpleTable) GetString ¶
func (t *SimpleTable) GetString(col int) string
func (*SimpleTable) GetStringByColName ¶
func (t *SimpleTable) GetStringByColName(colName string) string
func (*SimpleTable) Next ¶
func (t *SimpleTable) Next() bool
Source Files ¶
Click to show internal directories.
Click to hide internal directories.