tsv

package
v0.1.231 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package tsv implements a decoder for tab separated data. CSV looks like a simple format, but its surprisingly hard to create valid CSV files. Sometimes simply splitting a string circumvents all the problems that come with quoting styles, field counts and so on.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Decoder

type Decoder struct {
	Header    []string // Column names.
	Separator string   // Field separator.
	// contains filtered or unexported fields
}

A Decoder reads and decodes TSV rows from an input stream.

func NewDecoder

func NewDecoder(r io.Reader) *Decoder

NewDecoder returns a new decoder with tab as field separator.

func NewDecoderSeparator

func NewDecoderSeparator(r io.Reader, sep string) *Decoder

NewDecoderSeparator creates a new decoder with a given separator.

func (*Decoder) Decode

func (dec *Decoder) Decode(v interface{}) error

Decode a single entry, reuse csv struct tags.

Jump to

Keyboard shortcuts

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