csvnewcol

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

func CreateNewColumnExprs

func CreateNewColumnExprs(newColString string, cols []string) ([][]Expression, error)

CreateNewColumnExprs creates an a new cell (slice of expressions) for each semicolon separated item

func GenColumns

func GenColumns(newcols [][]Expression, row []string) []string

GenColumns will return newly generated columns from a 2d expression slice and a row

Types

type Expression

type Expression interface {
	// contains filtered or unexported methods
}

Expression allows generating a new column given a row

func CreateExpressions

func CreateExpressions(exprString string, cols []string) ([]Expression, error)

CreateExpressions creates a list of expressions based on a string and the header row (column names)

type Reader

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

Reader reads a CSV row that may have new columns

func NewReader

func NewReader(r csvReader, exprs [][]Expression) *Reader

NewReader creates a reader from a csvReader interface and expression list

func (*Reader) Read

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

Read reads a line with the added columns

Jump to

Keyboard shortcuts

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