1
- .TH TABCOLS 1NEMO "20 November 2022 "
1
+ .TH TABCOLS 1NEMO "10 September 2024 "
2
2
3
3
.SH "NAME"
4
4
tabcols \- Select columns, and optionally rearrange, from a table
@@ -7,13 +7,13 @@ tabcols \- Select columns, and optionally rearrange, from a table
7
7
\fP tabcols\fP [parameter=value] ...
8
8
9
9
.SH "DESCRIPTION"
10
- \fB tabcols \fP selects columns from a file, and can also re-arrange the
10
+ \fB tabcols \fP selects columns from a file, and can thus also re-arrange the
11
11
output column order. New column separators can be used on output.
12
12
This way a newline on input can be converted into a space on
13
13
output and therefore creating a file with one long column from
14
- a table with mulitple columns.
14
+ a table with multiple columns.
15
15
.PP
16
- To select specific lines, use \fI tabrows(1NEMO) \fP or \fI tabmath(1NEMO) \fP .
16
+ To select specific rows/ lines, use \fI tabrows(1NEMO) \fP or \fI tabmath(1NEMO) \fP .
17
17
.PP
18
18
To align a table by column, use the \fI column(1) \fP program with the \fB -t \fP
19
19
option.
@@ -22,28 +22,41 @@ option.
22
22
.so man1/parameters
23
23
.TP 20
24
24
\fB in= \fP
25
- input file name(s). No default.
25
+ input file name(s).
26
+ .br
27
+ No default.
26
28
.TP
27
29
\fB select= \fP
28
30
list of columns to select. Any \fI nemoinp(1NEMO) \fP expression can be used.
29
31
Columns can be repeated, and in any order. The output will be in exactly
30
32
the same order as given with this keyword. First column is 1. Column 0 can also
31
33
be added to the output, which is the row number (first row is 1).
34
+ .br
32
35
[all]
33
36
.TP
34
37
\fB colsep= \fP
35
38
Column separator. Valid are: \fB s \fP (space), \fB n \fP (newline),
36
39
\fB t \fP (tab),
37
40
\fB r \fP (carriage return), as well as the literal symbols '\fB , \fP '
38
41
and '\fB : \fP '.
42
+ .br
39
43
[Default: \fB s \fP ]
44
+
45
+ .TP
46
+ \fB colsepin= \fP
47
+ Column separator for input. By default an internal set (space, comma, tab, vertical bar)
48
+ is used. A string can be specified here consistent of multiple characters.
49
+
50
+
40
51
.TP
41
52
\fB out=- \fP
42
53
output file name. By default standard output it used.
54
+ .br
55
+ [-]
43
56
44
57
.SH "CAVEATS"
45
58
Although this program uses the new table interface, there are
46
- still some internal variables that limits the column count.
59
+ still some internal variables that limit the column count.
47
60
48
61
.SH "EXAMPLE"
49
62
Here is an example of how to reverse the columns from a table with 4 columns:
@@ -55,9 +68,13 @@ re-arranges all the numbers in a table in one long column
55
68
.nf
56
69
tabcols in.tab all n > out.tab
57
70
.fi
71
+ or in one long row:
72
+ .nf
73
+ tabcols in.tab all n | tabtranspose - - > out.tab
74
+ .fi
58
75
59
76
.SH "SEE ALSO"
60
- tabrows(1NEMO), tabmath(1NEMO), tabs(1NEMO), tabtab(1NEMO), awk(1), column(1)
77
+ tabrows(1NEMO), tabtranspos(1NEMO), tabmath(1NEMO), tabs(1NEMO), tabtab(1NEMO), awk(1), column(1)
61
78
62
79
.SH "FILES"
63
80
src/kernel/tab/tabcols.c source code
@@ -71,4 +88,5 @@ Peter Teuben
71
88
26-Jan-00 V1.0 Created PJT
72
89
9-apr-09 V2.0 out=- now default and last argument PJT
73
90
5-may-2022 V2.1 converted to table V2 interface PJT
91
+ 10-sep-2024 V2.4 added colsepin= PJT
74
92
.fi
0 commit comments