csvtrunc

package
v0.0.0-...-617864f Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

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 is used for reading a csv file between the start and end parameters

func NewReader

func NewReader(r io.Reader, start int, stop int) (*Reader, []string, error)

NewReader creates a new object that automatically discards lines until start and only reads up until the stop line (inclusive). If stop is <= 0, we don't use it to calculate a stopping point. Note that this is 1-indexed, but only if you consider the first row (the column names) the 0th index. Note that the first row is returned, so that column names can be known.

func (*Reader) Line

func (r *Reader) Line() int

Line returns the current line number

func (*Reader) Read

func (r *Reader) Read() ([]string, error)

Read reads a line from the csv. It checks to make sure that the line is before end

Jump to

Keyboard shortcuts

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