csv

package
v0.0.0-...-a8c716a Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CsvParser

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

nolint

func NewCsvParser

func NewCsvParser(context context.Context, opts ...ParserWithOption) *CsvParser

func (*CsvParser) AsyncReadAllRows

func (c *CsvParser) AsyncReadAllRows(ctx context.Context, filepath string, ops ...ReaderWithOption) (<-chan []string, error)

异步读取csv文件

func (*CsvParser) ReadFromFile

func (c *CsvParser) ReadFromFile(filepath string, ops ...ReaderWithOption) (dataList [][]string, err error)

读取整个csv文件

type ParserWithOption

type ParserWithOption func(*CsvParser)

func WithNewLogger

func WithNewLogger(logg logger.Logger) ParserWithOption

type ReaderWithOption

type ReaderWithOption func(*csv.Reader)

func ReaderWithComma

func ReaderWithComma(flag rune) ReaderWithOption

ReaderWithComma 设置分隔符 默认 ','

func ReaderWithComment

func ReaderWithComment(flag rune) ReaderWithOption

ReaderWithComment 设置评论标识 默认是 空的

Jump to

Keyboard shortcuts

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