csvparser

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2019 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrBareQuote  = errors.New("bare \" in non-quoted-field")
	ErrQuote      = errors.New("extraneous or missing \" in quoted-field")
	ErrFieldCount = errors.New("wrong number of fields")
)

Functions

This section is empty.

Types

type Parser

type Parser struct {
	LazyQuotes       bool
	TrimLeadingSpace bool
	Comma            rune
	Comment          rune
	FieldsPerRecord  int
	// contains filtered or unexported fields
}

Parser parses comma-separated values (CSV) lines. see csv.Reader std package for fields description.

func (*Parser) Parse

func (r *Parser) Parse(line []byte) ([]string, error)

Parse parses CSV string (slice of fields), it's a copy of csv.Reader.readRecord private method.

func (*Parser) ParseString

func (r *Parser) ParseString(line string) ([]string, error)

ParseString parses CSV string, it's a copy of csv.Reader.readRecord private method.

Jump to

Keyboard shortcuts

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