csvutils

package
v0.0.101 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCSVDataType added in v0.0.69

func GetCSVDataType(raw []byte, separator rune) (Headers, CSVData, map[string]string, error)

GetCSVDataType is delegated to retrieve the data type for every field of the CSV Return: headers, csv data, data type, error

func GetCol added in v0.0.98

func GetCol(csvData CSVData, index int) []string

GetCol is delegated to filter a given column from the csvData

func ReadCSV added in v0.0.43

func ReadCSV(data []byte, separator rune, hasHeaders bool) (Headers, CSVData, error)

ReadCSV is delegated to read into a CSV the content of the bytes in input []string -> Headers of the CSV [][]string -> Content of the CSV

func WriteCSV added in v0.0.44

func WriteCSV(headers Headers, records CSVData, separator rune) ([]byte, error)

Types

type ApplyCSV added in v0.0.101

type ApplyCSV func(int, []string) []string

type ApplyHeader added in v0.0.101

type ApplyHeader func(int, *string) string

type CSVData added in v0.0.101

type CSVData [][]string

func DecodeNonUTF8CSV added in v0.0.70

func DecodeNonUTF8CSV(data CSVData) CSVData

func (*CSVData) Apply added in v0.0.101

func (c *CSVData) Apply(fn ApplyCSV, inplace bool) CSVData

func (*CSVData) Explode added in v0.0.101

func (c *CSVData) Explode(fn ExplodeCSV) CSVData

type ExplodeCSV added in v0.0.101

type ExplodeCSV func(int, []string) [][]string

type Headers added in v0.0.101

type Headers []string

FIXME: Migrate the module to map[headers][]row

func (*Headers) Apply added in v0.0.101

func (c *Headers) Apply(fn ApplyHeader, inplace bool) Headers

Jump to

Keyboard shortcuts

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