tcat

command module
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2025 License: BSD-3-Clause Imports: 2 Imported by: 0

README

tcat

The authoritative version of tcat (of my fork, that is) lives on sourcehut. Anything else is a mirror and may lag behind.

The import path is md0.org/tcat.

Installation

go install md0.org/tcat@latest

md0.org fork

Forked from rsc.io/tcat in order to add option to split input on commas (-c option).

Later extended to split on pipes ("|"; -p), tabs (-t), and also anything else via --is (see usage).

modified original README

Tcat is a tabular cat.

Usage:

tcat [-cpt] [--is <string>] [--os <string>] [file...]
  --comma/-c use comma for input separator
  --pipe/-p  use pipe ('|') for input separator
  --tab/-t   use tab for input separator
  --is       specify input separator
  --os       specify output separator
  --sections (bool) allow sections or not
  --secsep   prefix of section separator (default "----")
("-t" takes precedence over "-c" which takes precedence over "-p"
which takes precedence over "-is")

Tcat reads the named input files, splits each line into space-(or comma-)separate fields, and then reprints the input aligning columns of fields.

"Sections" can be accommodated by passing --sections=true and then any line starting with "secep" (default "----") will be passed through tcat untouched.

See it in action:

go build
./tcat testdata/spaces
./tcat -c testdata/commas
./tcat -p testdata/pipes
./tcat -t testdata/tabs

License

BSD 3-Clause "New" or "Revised" License

(This repository retains the license from the original repository it was forked from, rsc.io/tcat. That repository's license is copied verbatim. See LICENSE for details.)

Documentation

Overview

Tcat is a tabular cat.

Directories

Path Synopsis
internal
tabularcat
Tcat is a tabular cat.
Tcat is a tabular cat.

Jump to

Keyboard shortcuts

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