hastycsv: github.com/cet001/hastycsv Index | Files | Directories

package hastycsv

import "github.com/cet001/hastycsv"

Package hastycsv is fast, simple, and NOT-RFC-4180-COMPLIANT CSV reader.

Take a look at README and code examples in https://github.com/cet001/hastycsv for usage.

Index

Package Files

hastycsv.go

func ParseUint32 Uses

func ParseUint32(data []byte) (uint32, error)

ParseUint32() parses an ascii byte array into a uint32 value.

func ReadFile Uses

func ReadFile(csvFilePath string, comma byte, nextRecord Next) error

type Field Uses

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

Represents a field (encoded as a UTF-8 string) within a CSV record.

func (Field) Bytes Uses

func (me Field) Bytes() []byte

Returns the backing byte slice of this field.

func (Field) Float32 Uses

func (me Field) Float32() float32

Parses this field as a float32.

func (Field) IsEmpty Uses

func (me Field) IsEmpty() bool

Returns true if this field is empty.

func (Field) String Uses

func (me Field) String() string

Returns this field as a string.

func (Field) ToLower Uses

func (me Field) ToLower() Field

Interprets this field as an ASCII string and performs an in-place conversion to lowercase.

func (Field) Uint32 Uses

func (me Field) Uint32() uint32

Parses this field as a Uint32.

type Next Uses

type Next func(i int, record []Field) error

Definition of a callback function that serves as a sequential record iterator. Read() and ReadFile() will stop reading the input records if this function returns an error.

type Reader Uses

type Reader struct {
    // Comma is the field delimiter.
    // It is set to comma (',') by NewReader.
    // Comma cannot be \r or \n.
    Comma byte
    // contains filtered or unexported fields
}

Reads records from a CSV-encoded file or io.Reader.

func NewReader Uses

func NewReader() *Reader

Returns a new Reader whose Delimiter is set to the comma character (',').

func (*Reader) Read Uses

func (me *Reader) Read(r io.Reader, nextRecord Next) error

Directories

PathSynopsis
examples

Package hastycsv imports 8 packages (graph) and is imported by 1 packages. Updated 2019-06-27. Refresh now. Tools for package owners.