csvHandler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2021 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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