csvutil

package
v0.0.0-...-000f34f Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2018 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package csvutil provides ways to extract csv data from one or more files.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CSVFiles

type CSVFiles struct {
	Files []string
	// Indicates if the CSV files don't have a header.
	NoHeader bool
	// Indicates if the 0 value should be filtered.
	FilterZero bool
}

CSVFiles - Struct containing CSV file information.

func New

func New(files ...string) *CSVFiles

New - Returns a `*csvutil.CSVFiles` with the files given.

func (*CSVFiles) GetCSVColumns

func (cf *CSVFiles) GetCSVColumns(columns ...int) ([][]string, error)

GetCSVColumns - Reads csv lines from *csvutil.CSVFiles and returns the requested columns. If the column lenghts are different, it will error out (necessary here? maybe the caller should check for that.)

func (*CSVFiles) GetFloat64Columns

func (cf *CSVFiles) GetFloat64Columns(columns ...int) ([][]float64, error)

GetFloat64Columns - given a set of CSV files and a list of columns, it will return those columns as a slice of floats. If filterZero is set, it will ignore Zero values. If the column lenghts are different, it will error out (necessary here? maybe the caller should check for that.)

func (*CSVFiles) PrintCSVRows

func (cf *CSVFiles) PrintCSVRows(rows ...int) error

PrintCSVRows - prints the given csv rows

Jump to

Keyboard shortcuts

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