mcsv

package module
v0.0.0-...-7ed79d3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2015 License: Apache-2.0 Imports: 6 Imported by: 1

README

mcsv

Mabetle Go CSV

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCsvContent

func BuildCsvContent(data [][]string) (r string)

func Init

func Init()

func WriteData

func WriteData(location string, data [][]string) error

WriteData

Types

type CSV

type CSV struct {
	// contains filtered or unexported fields
}

define CSV

func NewCSV

func NewCSV(file string) *CSV

return *CSV

func (*CSV) GetColumnNameIndex

func (c *CSV) GetColumnNameIndex(columnName string) int

func (*CSV) GetColumns

func (c *CSV) GetColumns() int

return CSV Columns

func (*CSV) GetData

func (c *CSV) GetData() [][]string

return CSV Data

func (*CSV) GetHeaderRow

func (c *CSV) GetHeaderRow() []string

return CSV HeaderRow

func (*CSV) GetRow

func (c *CSV) GetRow(row int) []string

parameter row return CSV Row

func (*CSV) GetRows

func (c *CSV) GetRows() int

return CSV Rows

func (*CSV) GetString

func (c *CSV) GetString(row int, column int) string

return CSV row and column value

func (*CSV) GetStringByColumnIndex

func (c *CSV) GetStringByColumnIndex(column int) string

func (*CSV) GetStringByName

func (c *CSV) GetStringByName(columnName string) string

func (*CSV) Next

func (c *CSV) Next() bool

func (*CSV) ShowContent

func (c *CSV) ShowContent()

show CSV Content

func (CSV) Write

func (csv CSV) Write(file string)

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

func (RandomAccessTable) GetString

func (table RandomAccessTable) GetString(row int, col int) string

has out of index error

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) GetRows

func (t *SimpleTable) GetRows() int

implements for sdb.SimpleTable

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

Directories

Path Synopsis
demo

Jump to

Keyboard shortcuts

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