csvutil

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2021 License: MIT Imports: 5 Imported by: 0

README

csvutil

create and manage data structures from cvs files

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateCSVReaderFromIOReadSeeker

func CreateCSVReaderFromIOReadSeeker(file io.ReadSeeker) *csv.Reader

func CreateCSVReaderFromIOReader

func CreateCSVReaderFromIOReader(file io.Reader) *csv.Reader

func SkipBOM

func SkipBOM(fd io.ReadSeeker) error

Types

type CsvStruct

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

func LoadFile

func LoadFile(csvFile string) (*CsvStruct, error)

LoadFile reads the csv file and creates a csvStruct object

func LoadFromCSVReader

func LoadFromCSVReader(r *csv.Reader) (*CsvStruct, error)

LoadFromCSVReader creates csvStruct object from a csv.reader

func LoadFromIOReader

func LoadFromIOReader(reader io.Reader) (*CsvStruct, error)

LoadFromIOReader creates csvStruct object from a io.reader

func NewCsvStruct added in v0.0.2

func NewCsvStruct(headers []string) (*CsvStruct, error)

func (*CsvStruct) Add

func (r *CsvStruct) Add(s *CsvStruct) error

func (*CsvStruct) Append added in v0.0.2

func (r *CsvStruct) Append(row []string) error

func (*CsvStruct) FindEntry

func (r *CsvStruct) FindEntry(headerName string, value string) ([]string, int)

func (*CsvStruct) FindEntryI

func (r *CsvStruct) FindEntryI(headerIndex int, value string) ([]string, int)

func (*CsvStruct) GetValueAtIndex

func (r *CsvStruct) GetValueAtIndex(rowIndex, headerIndex int) (string, error)

func (*CsvStruct) HeaderAtIndex

func (r *CsvStruct) HeaderAtIndex(i int) (string, error)

func (*CsvStruct) HeaderCount

func (r *CsvStruct) HeaderCount() int

func (*CsvStruct) HeaderIndex

func (r *CsvStruct) HeaderIndex(headerName string) int

func (*CsvStruct) Headers

func (r *CsvStruct) Headers() []string

func (*CsvStruct) RowAtIndex

func (r *CsvStruct) RowAtIndex(i int) []string

func (*CsvStruct) RowCount

func (r *CsvStruct) RowCount() int

func (*CsvStruct) SetValueAtIndex

func (r *CsvStruct) SetValueAtIndex(rowIndex, headerIndex int, value string) error

func (*CsvStruct) Write2File

func (r *CsvStruct) Write2File(f string) error

Jump to

Keyboard shortcuts

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