csvfile

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package csvfile reads the semicolon- or comma-separated files upstream sources publish, record by record, after checking their header. Its errors never quote a value of the file: it may hold personal data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Reader

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

Reader reads the records of a file after its header.

func Open

func Open(r io.Reader, want []string, errFormat error) (*Reader, error)

Open checks that the semicolon-separated r starts with the header want and returns a reader of the records after it. A departure from the format is reported with errFormat, the source's own error.

func OpenSeparated added in v0.18.0

func OpenSeparated(r io.Reader, comma rune, want []string, errFormat error) (*Reader, error)

OpenSeparated is Open for a file whose fields are separated by comma. Both skip a leading UTF-8 byte order mark.

func (*Reader) Each

func (r *Reader) Each(add func(rec []string) error) error

Each calls add with every record, which add must not keep: the next one reuses it. It stops at the first error, located by line.

Jump to

Keyboard shortcuts

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