Back to godoc.org
github.com/mithrandie/go-text/csv

package csv

v1.3.2
Latest Go to latest
Published: Aug 27, 2019 | License: MIT | Module: github.com/mithrandie/go-text

Overview

Package csv is a Go library to read and write CSV format.

Index

Constants

const QuotationMark = 0x22

type Field

type Field struct {
	Contents string
	Quote    bool
}

func NewField

func NewField(contents string, quote bool) Field

type Reader

type Reader struct {
	Delimiter   rune
	WithoutNull bool
	Encoding    text.Encoding

	FieldsPerRecord int

	DetectedLineBreak text.LineBreak
	EnclosedAll       bool
	// contains filtered or unexported fields
}

func NewReader

func NewReader(r io.Reader, enc text.Encoding) (*Reader, error)

func (*Reader) Read

func (r *Reader) Read() ([]text.RawText, error)

func (*Reader) ReadAll

func (r *Reader) ReadAll() ([][]text.RawText, error)

func (*Reader) ReadHeader

func (r *Reader) ReadHeader() ([]string, error)

type Writer

type Writer struct {
	Delimiter rune
	// contains filtered or unexported fields
}

func NewWriter

func NewWriter(w io.Writer, lineBreak text.LineBreak, enc text.Encoding) (*Writer, error)

func (*Writer) Flush

func (e *Writer) Flush() error

func (*Writer) Write

func (e *Writer) Write(record []Field) error
Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier