csv-analysis: github.com/DavidGamba/csv-analysis/csvutil Index | Files

package csvutil

import "github.com/DavidGamba/csv-analysis/csvutil"

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

Index

Package Files

csvutil.go

type CSVFiles Uses

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 Uses

func New(files ...string) *CSVFiles

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

func (*CSVFiles) GetCSVColumns Uses

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 Uses

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 Uses

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

PrintCSVRows - prints the given csv rows

Package csvutil imports 6 packages (graph) and is imported by 1 packages. Updated 2018-10-03. Refresh now. Tools for package owners.