csv

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2019 License: MIT Imports: 7 Imported by: 1

Documentation

Overview

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

Index

Constants

View Source
const QuotationMark = 0x22

Variables

This section is empty.

Functions

This section is empty.

Types

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

Jump to

Keyboard shortcuts

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