PASTE(1) COMMAND REFERENCE PASTE(1)
NAME
paste - merge same lines of several files or subsequent
lines of one file
SYNOPSIS
paste [ -dlist ] file1 file2 ...
paste -s [ -dlist ] file1 file2 ...
DESCRIPTION
In the first form, paste ^ concatenates corresponding lines
of the given input files file1, file2, etc. It treats each
file as a column or columns of a table and pastes them
together horizontally (parallel merging). It is the
counterpart of cat(1) which concatenates vertically, i.e.,
one file after the other. In the second form above, paste
subsumes the function of an older command with the same name
by combining subsequent lines of the input file (serial
merging). In all cases, lines are glued together with the
tab character, or with characters from an optionally
specified list. Output is to the standard output, so it can
be used as the start of a pipe, or as a filter, if - is used
in place of a file name.
OPTIONS
-d Without this option, the new-line characters of each but
the last file (or last line in case of the -s option) are
replaced by a tab character. This option allows
replacing the tab character by one or more alternate
characters (see below).
list
One or more characters immediately following -d replace
the default tab as the line concatenation character. The
list is used circularly, i. e. when exhausted, it is
reused. In parallel merging (i. e. no -s option), the
lines from the last file are always terminated with a
new-line character, not from the list. The list may
contain the special escape sequences: \n (new-line), \t
(tab), \\ (backslash), and \0 (empty string, not a null
character). Quoting may be necessary, if characters have
special meaning to the shell (e.g. to get one backslash,
use "" -d"\\\\" ).
-s Merge subsequent lines rather than one from each input
file. Use tab for concatenation, unless a list is
specified with -d option. Regardless of the list, the
very last character of the file is forced to be a new-
line.
- May be used in place of any file name, to read a line
from the standard input. (There is no prompting).
Printed 4/6/89 1
PASTE(1) COMMAND REFERENCE PASTE(1)
EXAMPLES
ls | paste -d" " -
lists directory in one column
ls | paste - - - -
lists directory in four columns
paste -s -d"\t\n" file
combines pairs of lines into single lines
pr -t -m file
works like paste but creates extra blanks, tabs, and
newlines for a nice page layout.
RETURN VALUE
[NO_ERRS] Command completed without error.
[USAGE] Incorrect command line syntax. Execution
terminated.
[NP_ERR] An error occurred that was not a system
error. Execution terminated.
[P_ERR] A system error occurred. Execution
terminated. See intro(2) for more
information on system errors.
CAVEATS
Line length is limited to 1023 characters. An error will be
produced if a line of greater lingth is encountered.
With the exception of usage with the -s option, no more than
17 input files may be specified.
SEE ALSO
awk(1), comm(1), cut(1), egrep(1), fgrep(1), grep(1),
join(1), look(1), sort(1), and uniq(1).
Printed 4/6/89 2
%%index%%
na:264,130;
sy:394,369;
de:763,1070;
op:1833,1695;
ex:3864,477;
rv:4341,555;
ca:4896,328;
se:5224,294;
%%index%%000000000136