blob: ba1d8d516867b9bfd06c0e2c84a092dcaf7c63d8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
.TH spt 1 2022-05-27 utils
.SH NAME
spt \- single pass tabulate
.SH SYNOPSIS
.B spt
.SH DESCRIPTION
.B spt
reads a grid-aligned table from stdin
and outputs the same data on stdout
as tab-separated values.
Only the first line is used to guess where in the grid
are the column separators.
Any sequence of more than one blank character
is taken to separate columns, so if in the first line
two colum values happen to be separated by a single space,
.B spt
will guess wrong.
.RB ( vd (1)
uses the first 1000 lines, which is a lot safer,
but with grid separated values there can be no guarantee.)
In addition, if the input data contains tabs already,
those are not escaped, but preserved.
If that is a problem, you'll need to escape them beforehand, for example using
.BR sed (1)
like so:
.RS
.BI sed \ 's:\et:\e\et:g'
.RE
.SH EXAMPLES
.B spt
.RI <\ grid-table\ >\ table.tsv
.SH SEE ALSO
.BR col (1),\ vd (1)
|