csvbad

package
v0.0.0-...-e081c89 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: GPL-2.0 Imports: 14 Imported by: 0

README

Builtins: csv-bad

This provides support for non-standard CSV files.

It is an optional builtin but is recommended to leave enabled.

Documentation

Overview

Package csvbad provides definitions for the `csv-bad` data type

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {
	Separator byte
	Quote     byte
	Comment   byte
	Headings  bool
	// contains filtered or unexported fields
}

Parser is the CSV parser settings

func NewParser

func NewParser(reader io.Reader, config *config.Config) (parser *Parser, err error)

NewParser creates a new CSV reader and writer - albeit it doesn't conform to Go's io.Reader / io.Writer interface{}. The sensible thing might have been to create this as a marshaller but it's written now and works so little point breaking it at this point in time.

func (*Parser) ArrayToCsv

func (parser *Parser) ArrayToCsv(array []string) (csv []byte)

ArrayToCsv marshals a list into a CSV line

func (*Parser) ReadLine

func (parser *Parser) ReadLine(callback func(records []string, headings []string)) (err error)

ReadLine - read a line from a CSV file

Jump to

Keyboard shortcuts

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