tableutil

package
v0.4.13 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PadTable

func PadTable(table [][]string, colCnt int)

func TableColAt

func TableColAt(table [][]string, idx int) []string

Collect table col at idx.

Types

type Range

type Range struct {
	Min int
	Max int
}

func ZeroRange

func ZeroRange() Range

func (Range) In

func (c Range) In(i int) bool

func (Range) Nil

func (c Range) Nil() bool

type TableTransform

type TableTransform struct {
	// Skip row range.
	//
	// You don't need to skip rows in HeaderRowRangeExpr.
	SkipRowRangeSpec *Range
	// Include column range.
	InclColRangeSpec *Range
	// Header row range.
	HeaderRowRangeSpec *Range
	// Row Seperator, default to `'\n'`
	RowSeperator string
	// Col Seperator, default to `'  '` (two spaces)
	ColSeperator string
}

Table Transform

Transform rows and columns while reading.

func (TableTransform) HeaderRowRange

func (p TableTransform) HeaderRowRange() Range

func (TableTransform) InclColRange

func (p TableTransform) InclColRange() Range

func (TableTransform) ParseFile

func (p TableTransform) ParseFile(rail miso.Rail, reader interface{ Read() ([]string, error) }) (string, error)

func (TableTransform) ParseFileLoaded

func (p TableTransform) ParseFileLoaded(rail miso.Rail, rows [][]string) (string, error)

func (TableTransform) SkipRowRange

func (p TableTransform) SkipRowRange() Range

func (TableTransform) WriteRow

func (p TableTransform) WriteRow(buf *strings.Builder, header []string, inclColRange Range, r []string)

Jump to

Keyboard shortcuts

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