tablook

package module
v0.0.0-...-43cd2b7 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2015 License: MIT Imports: 4 Imported by: 0

README

tablook

less for tabular data, with csvless command as example

library

you can look on your [][]string data by:

tbl, err := tablook.New(some_data)
// remember to handle errors
err = tablook.Show()

full example in example/simple.go

standalone command for csv files

just go get github.com/komosa/tablook/cmd/csvless and then you can:

  • pipe csv data to csvless (eg. from John Kerl's mlr tool)
  • open your csv files with csvless filename.csv

keybindings

key behaviour
q quit app / returns from Tab.Show()
arrows scroll view
j/k move highlighted line down/up
h/l change selected column to one on left/right side of current one
d deletes selected column (or start over with all visible instead of removing the last one)

bonus

  • works with characters wider than one cell
  • handles terminal resizes smoothly

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FgColor        = termbox.ColorWhite
	BgColor        = termbox.ColorBlack
	SelColor       = termbox.ColorBlue
	SelColumnColor = termbox.ColorGreen
)
View Source
var ErrTermboxAlreadyInitialized = errors.New("tablook: termbox (or termui) already initialized")
View Source
var ErrTooFewRecords = errors.New("tablook: at least one row must be given in addition to header row")

Functions

This section is empty.

Types

type Tab

type Tab struct {
	// contains filtered or unexported fields
}

func New

func New(records [][]string) (Tab, error)

func (Tab) Show

func (data Tab) Show() error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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