csv

package
v0.0.0-...-3e23f1e Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVReader

type CSVReader struct {

	// If true, the scanner will continue scanning if field-level errors are
	// encountered. The error should be checked after each call to Scan to
	// handle the error.
	ContinueOnError bool
	// contains filtered or unexported fields
}

CSVReader provides an interface for reading CSV data (compatible with rfc4180 and extended with the option of having a separator other than ","). Successive calls to the Scan method will step through the 'fields', skipping the separator/newline between the fields. The EndOfRecord method tells when a field is terminated by a line break.

func DefaultCSVReader

func DefaultCSVReader(rd io.Reader) *CSVReader

DefaultReader creates a "standard" CSV reader.

func NewCSVReader

func NewCSVReader(r io.Reader, sep byte) *CSVReader

NewReader returns a new CSV scanner.

func (*CSVReader) ColumnNumber

func (s *CSVReader) ColumnNumber() int

ColumnNumber returns the column index of the current field.

func (*CSVReader) EndOfRecord

func (s *CSVReader) EndOfRecord() bool

EndOfRecord returns true when the most recent field has been terminated by a newline (not a separator).

func (*CSVReader) Err

func (s *CSVReader) Err() error

Err returns an error if one occurred during scanning.

func (*CSVReader) Line

func (s *CSVReader) Line() string

Line returns the current line as a string.

func (*CSVReader) LineNumber

func (s *CSVReader) LineNumber() int

LineNumber returns current line number.

func (*CSVReader) Read

func (s *CSVReader) Read() ([]string, error)

Read scans all fields in one line builds a slice of values.

func (*CSVReader) Scan

func (s *CSVReader) Scan() bool

func (*CSVReader) ScanLine

func (s *CSVReader) ScanLine(r []string) error

ScanLine scans all fields in one line and puts the values in the passed slice.

func (*CSVReader) Text

func (s *CSVReader) Text() string

Text returns the text of the current field.

type Profiler

type Profiler struct {
	Config    *profile.Config
	Delimiter byte
	Header    bool
	// contains filtered or unexported fields
}

func NewProfiler

func NewProfiler(r io.Reader) *Profiler

func (*Profiler) Profile

func (x *Profiler) Profile() (*profile.Profile, error)

Jump to

Keyboard shortcuts

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