Documentation
¶
Index ¶
- Variables
- func Delimiter(delimiter rune) option
- func Equals(datasetA, datasetB [][]string) bool
- func UseCLRF(useCLRF bool) option
- type Dataset
- func (ds *Dataset) AddCol(column []string, index int) error
- func (ds *Dataset) AddRow(row []string) error
- func (ds *Dataset) AddRows(rows [][]string) error
- func (ds *Dataset) DeleteCol(name string) error
- func (ds *Dataset) GetCol(name string) ([]string, error)
- func (ds *Dataset) ModifyCol(name string, f func(val string, row int) string) error
- func (ds *Dataset) MoveCol(name string, index int) error
- func (ds *Dataset) Raw() [][]string
- func (ds *Dataset) RenameCol(old, new string) error
- func (ds *Dataset) Write(writer io.Writer, opts ...option) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrColNotFound is returned when a named column is not found. ErrColNotFound = errors.New("column not found") // ErrSameColName is returned when a named column exists multiple times. ErrSameColName = errors.New("multiple columns with same name") // ErrColLen is returned when the length of a column to add differs from the already existing dataset column length. ErrColLen = errors.New("length of columns differ") )
Functions ¶
func Delimiter ¶
func Delimiter(delimiter rune) option
Delimiter is the separator between each value (default: ',').
Types ¶
type Dataset ¶
type Dataset struct {
// contains filtered or unexported fields
}
Dataset contains the CSV content and eases modificating it.
func (*Dataset) AddCol ¶
AddCol inserts the given column at the position of the index. -1 adds the column at the last column -2 adds the column as the second last column, and so on...
func (*Dataset) ModifyCol ¶
ModifyCol changes the values of column 'name' according to 'f'. 'val' contains the column value and 'row' is the current row number.
Click to show internal directories.
Click to hide internal directories.
