From c88cf06bfc0aff9a25e1fe96857f892929c94ff1 Mon Sep 17 00:00:00 2001 From: Andreas Hrubak Date: Thu, 7 Nov 2024 13:31:30 +0100 Subject: [PATCH] upload manpage --- tabdata/td-alter.1 | 126 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 tabdata/td-alter.1 diff --git a/tabdata/td-alter.1 b/tabdata/td-alter.1 new file mode 100644 index 0000000..4d84daf --- /dev/null +++ b/tabdata/td-alter.1 @@ -0,0 +1,126 @@ +.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.43) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +. ds C` +. ds C' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is >0, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.\" +.\" Avoid warning from groff about undefined register 'F'. +.de IX +.. +.nr rF 0 +.if \n(.g .if rF .nr rF 1 +.if (\n(rF:(\n(.g==0)) \{\ +. if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. if !\nF==2 \{\ +. nr % 0 +. nr F 2 +. \} +. \} +.\} +.rr rF +.\" ======================================================================== +.\" +.IX Title "td-alter 1" +.TH td-alter 1 "2024-08-07" "perl v5.36.0" "User Contributed Perl Documentation" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +td\-alter \- Add new columns and fields to tabular data stream, and modify value of existing fields. +.SH "USAGE" +.IX Header "USAGE" +td-alter \fI\s-1COLUMN\s0\fR=\fI\s-1EXPR\s0\fR [\fI\s-1COLUMN\s0\fR=\fI\s-1EXPR\s0\fR [\fI\s-1COLUMN\s0\fR=\fI\s-1EXPR\s0\fR [...]]] +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +On each data row, sets field in \fI\s-1COLUMN\s0\fR to the value resulted by \fI\s-1EXPR\s0\fR +Perl expression. +.PP +In \fI\s-1EXPR\s0\fR, you may refer to other fields by \f(CW$F{NAME}\fR where \fI\s-1NAME\s0\fR is the column name; +or by \f(CW$F[INDEX]\fR where \fI\s-1INDEX\s0\fR is the 0\-based column index number. +Furthermore you may refer to uppercase alpha-numeric field names, simply by bareword \f(CW\*(C`COLUMN\*(C'\fR, +well, enclosed in paretheses like \f(CW\*(C`(COLUMN)\*(C'\fR to avoid parsing unambiguity in Perl. +It's possible because these column names are set up as subroutines internally. +.PP +Topic variable (\f(CW$_\fR) initially is set to the current value of \fI\s-1COLUMN\s0\fR in \fI\s-1EXPR\s0\fR. +So for example \f(CW\*(C`N=\*(Aq\-$_\*(Aq\*(C'\fR makes the field N the negative of itself. +.PP +You can create new columns simply by referring to a \fI\s-1COLUMN\s0\fR name that does not exist yet. +You can refer to an earlier defined \fI\s-1COLUMN\s0\fR in subsequent \fI\s-1EXPR\s0\fR expressions. +.SH "EXAMPLES" +.IX Header "EXAMPLES" +Add new columns: \s-1TYPE\s0 and \s-1IS_BIGFILE. +IS_BIGFILE\s0 depends on previously defined \s-1TYPE\s0 field. +.PP +.Vb 1 +\& ls \-l | td\-trans\-ls | td\-alter TYPE=\*(Aqsubstr MODE,0,1\*(Aq IS_BIGFILE=\*(AqSIZE>10000000 && TYPE ne "d" ? "yes" : "no"\*(Aq +.Ve +.PP +Strip sub-seconds and timezone from \s-1DATETIME\s0 field: +.PP +.Vb 1 +\& TIME_STYLE=full\-iso ls \-l | td\-trans\-ls | td\-alter DATETIME=\*(Aqs/\e..*//; $_\*(Aq +.Ve +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\-H, \-\-no\*(--header" 4 +.IX Item "-H, --noheader" +do not show headers +.IP "\-h, \-\-header" 4 +.IX Item "-h, --header" +show headers (default) +.SH "REFERENCES" +.IX Header "REFERENCES" +\&\*(L"Alter\*(R" in td-alter comes from \s-1SQL.\s0 +\&\fBtd\-alter\fR\|(1) can change the \*(L"table\*(R" column layout. +But contrary to \s-1SQL\s0's \s-1ALTER TABLE,\s0 \fBtd\-alter\fR\|(1) can modify the records too, so akin to \s-1SQL UPDATE\s0 as well. -- 2.11.4.GIT