%++++++++
% Copyright:    (C) 2008-2015 UDS/CNRS
% License:       GNU General Public License
%.IDENTIFICATION trcol.tex
%.PURPOSE        Man page of trcol, can be edited in LaTeX
%.AUTHOR         Francois Ochsenbein
%.VERSION   1.0  21-Jul-1992
%.VERSION   1.1  07-Oct-1992: Added Formats
%.VERSION   1.2  11-Dec-1992: 5 columns in format file
%----------

\def\pgm{{\bf trcol}\ }
\begin{manpage} {1}{trcol}{Delete or Translate columns of a file}
	{Apr 2005}{Columns Translation}
\def\pfile{{\em file}}\def\cols{{\em cols} }
\syntax{ \pgm 
	[{\bf--a}\cols] [{\bf--A}\cols] 
	[{\bf--b}\cols] [{\bf--B}\cols] [{\bf--d}\cols] 
	[{\bf--l}\cols] [{\bf--r}\cols] [{\bf--s}\cols]
	[{\bf--t}\cols {\em s1} {\em s2}] 
	[{\em file...}] }

\mansec{ Description }
The \pgm command allows to delete or translate specified columns from a file.
A test for blanks (spaces or tabs) may be performed ({\bf--b} option).

The \cols selection has the form {\em start[{\bf--}end[,...]]},
{\em start} and {\em end} being the starting and ending column
of a field. For instance, colums 1, 3 to 5, and beyond 80 (81 or more)
are written  {\tt 1,3-5,81-}.
The complete line is written {\tt 1-}

Note that \pgm cannot exchange columns nor insert text; see {\bf acut}(1)
for such facilities.

\mansec{Options}

The options allow to specify whether we wish to {\em delete} or
{\em translate} columns.

\option{--a\cols}
   asks to transform to {\em lowercase} the specified columns.
\option{--A\cols}
   asks to transform to {\em uppercase} the specified columns.
\option{--b\cols}
   asks to {\em delete with blank test} the specified columns. Non-blank
   columns are deleted, but a warning message is issued for each non-blank
   character which was removed. The returned status is the number
   of non-blank deleted characters.
\option{--B\cols}
   is similar to the {\em -b} option, but no warning message is issued;
   just the number of deleted non-blank characters is returned as a status.
\option{--d\cols}
   asks to {\em delete} the specified columns without any test.
\option{--l\cols}
   asks to {\em left-justify} the specified columns -- blanks existing
   at the left are moved to the right.
\option{--r\cols}
   asks to {\em right-justify} the specified columns -- blanks existing
   at the right are moved to the left.
\option{--s\cols}
   asks to {\em squeeze blanks} in the specified columns: blanks existing
   at the left are mobed to the right, and multiple blanks
   are converted into a single blank.
\option{--t\cols} {\em s1} {\em s2}
   asks to translate in the columns defined by {\em cols} characters from
   {\em s1} into the corresponding characters of {\em s2} (byte-per-byte
   translation). Strings {\em s1} and {\em s2} must have the same length.
   The dash (-) may be used to specify intervals, e.g.
   {\tt a-z} for the 26 lowercase letters. 
   Non-printable characters can be specified using the C conventions.\\
   \underline{Note}: to remove a byte, use the {\tt\b 0}, e.g.
   \verb!trcol -t1- ' ' '\0'! removes all blanks.
\option{{\em file}} is the name of one or several (concatenated) input files. 
   {\em stdin} is the default input file. 

\mansec{Restrictions}
Only one operation is performed for each column; when the column ranges
specified by the various options overlap, the operation applied on the
shortest column is applied.

\mansec{Restrictions}
Only one operation is performed for each column; when the column ranges
specified by the various options overlap, the operation applied on the
shortest column is applied.

\mansec{Returned Status}
The \pgm command returns 0 for successful operation, 1 when one or
more n,on-blank columns are deleted (in the {\bf--b} or {\bf--B} options),
or 2 in case of error such as inexistant file.

\mansec{Example}
Remove from standard input columns 2 to 5 with error message 
for non-blank columns,
change the blank of column 6 to a zero, and convert cols 73 and above
to lower-case letters:

{\tt trcol -b2-5 -t6 ' ' '0' -t73- 'A-Z' 'a-z'}

\seealso{acut(1) }
\end{manpage}
