csvHandler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CsvStructure

type CsvStructure struct {
	// Public
	Ready               bool // true when csv data are present.
	Loaded              bool // true when loaded successfully.
	Comma               rune
	Comment             rune
	RowWithColName      int
	LazyQuotes          bool
	FieldsPerRecord     int
	TrimLeadingSpace    bool
	UseCRLF             bool
	Charset             string
	KeepOriginalCharset bool
	CsvLines            [][]string
	RawData             []string
	// contains filtered or unexported fields
}

func CsvStructureNew

func CsvStructureNew() *CsvStructure

func (*CsvStructure) FormatRawRow

func (cs *CsvStructure) FormatRawRow(row string) (outSlice []string, err error)

FormatRow: Formatting a Raw line to csv compliant. (usually used to preview column name)

func (*CsvStructure) Read

func (cs *CsvStructure) Read(filename string, autoOptions bool) (err error)

Read: open a reader and read entire file to memory and store datas into CsvStructure

func (*CsvStructure) ReadRawData

func (cs *CsvStructure) ReadRawData(filename string, autoOptions bool) (err error)

ReadRawData: Open CSV file as raw data (without csv formatting).

func (*CsvStructure) Save

func (cs *CsvStructure) Save(filename string, doBackup bool) (err error)

Save: use only os.file for sipmple operation or buffered if charset must be changed from utf-8 to the one used by original file.

Jump to

Keyboard shortcuts

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