Home

Awesome

tv(table viewer) for delimited text file(csv,tsv,etc) in terminal

Go Report Card test Coverage Status GitHub license GitHub release codechenx-tv

<p align="center"> <img src="data/icon-192x192.png" alt="tv icon"/> </p>

Introduction

asciicast

Table of Contents

Feature

To do

Installation

Prebuilt binaries

Bash(Linux and macOS, best choice for non-root user)

curl -fsSL https://raw.githubusercontent.com/codechenx/tv/master/install.sh | bash

* This command will download tv binary file to your current directory, you need to run sudo cp tv /usr/local/bin/ or copy tv binary file to any directory which is in the environment variable PATH

* You also can download tv binaries manually, from releases

Homebrew(Linux and macOS, only 64-bit)

brew install codechenx/tv/tv

Snap(Linux)

Get it from the Snap Store

*After installation, you need to run sudo snap alias codechenx-tv tv.This makes it possible to launch the application by tv

Debian package(Ubuntu, Debian, etc)

download from releases

RPM package(Centos, Fedora, etc)

download from releases

Build from source

Use go get to install and update:

go get -u github.com/codechenx/tv

Usage

Usage

tv {File_Name} [flags]

Flags

  --s string       (optional) Split symbol
  --is strings     (optional) Ignore lines with specific prefix(multiple arguments support, separated by comma)
  --in int         (optional) Ignore first N lines
  --nl int         (optional) Only display first N lines
  --dc ints        (optional) Only display specific columns(multiple arguments support, separated by comma)
  --hc ints        (optional) Do not display specific columns(multiple arguments support, separated by comma)
  --fi int         (optional) [default: 0]
                   -1, Unfreeze first row and first column
                    0, Freeze first row and first column
                    1, Freeze first row
                    2, Freeze first column
  --tr             (optional) Transpose data
  --strict         (optional) Check for missing data
  -h, --help       help for tv
  -v, --version    version for tv

tv also can recive data from pipe as an input

cat file.csv | tv

Sorting and Stats

For tv, there are two data types for every column, string, and number, which can affect the sorting function and the stats. The data type of the current column is shown on the right of the footer bar.You can change the data type of current column by Ctrl-m. the difference of column data type will determine how the column data would be sorted, as string or as number. In addition, for the column with the number data type, tv will show its minimal value, maximal value, and so on. But for the column with string data type. tv will count the number of every string.

Key binding

Keydescription
?Help page
h, left arrowMove left
l, right arrowMove right
j, down arrowMove down
k, upMove up
g, homeMove to first cell of table
G, endMove to last cell of table
Ctrl-f, page downMove down by one page
Ctrl-b, page upMove up by one page
Ctrl-eMove to end of current column
Ctrl-hMove to head of current column
Ctrl-mChange column data type to string or number
Ctrl-kSort data by column(ascend)
Ctrl-lSort data by column(descend)
Ctrl-yShow basic stats of current column, back to data table
Ctrl-cQuit

(Extra)Examples for common biological data

#vcf or compressed vcf format
tv file.vcf --is "##"
tv file.vcf.gz --is "##"
#qiime otu table
tv file.txt --is "# "
#maf format
tv file.maf --is "#"
#interval list
tv file.interval_list --is "@HD","@SQ"
tv file.interval_list --is "@"