Template:Short description Template:Lowercase {{#invoke:Infobox|infobox}}Template:Template other{{#invoke:Check for unknown parameters | check | showblankpositional=1 | unknown = Template:Main other | preview = Page using Template:Infobox software with unknown parameter "_VALUE_"|ignoreblank=y | AsOf | author | background | bodystyle | caption | collapsetext | collapsible | developer | discontinued | engine | engines | genre | included with | language | language count | language footnote | latest preview date | latest preview version | latest release date | latest release version | latest_preview_date | latest_preview_version | latest_release_date | latest_release_version | licence | license | logo | logo alt | logo caption | logo upright | logo size | logo title | logo_alt | logo_caption | logo_upright | logo_size | logo_title | middleware | module | name | operating system | operating_system | other_names | platform | programming language | programming_language | released | replaced_by | replaces | repo | screenshot | screenshot alt | screenshot upright | screenshot size | screenshot title | screenshot_alt | screenshot_upright | screenshot_size | screenshot_title | service_name | size | standard | title | ver layout | website | qid }}Template:Main other paste is a shell command that joins files horizontally (parallel merging) by writing to standard output lines consisting of the sequentially corresponding lines of each input file, separated by tabs.

The command reads each specified input file line-by-line. For each set of input lines, the command outputs a line formatted as the concatenation of the input files' lines separated by a tab character. If the content of a file runs out, the command will use an empty string for the file. As such, the number of output lines will equal the number of lines of the file with the most lines. Some implementations support using a fixed string (such as "NA") when a files content is exhausted before the others.

A sequence of empty records at the bottom of a column of the output stream may or may not have been present in the input file corresponding to that column as explicit empty records, unless you know the input file supplied all rows explicitly (e.g. in the canonical case where all input files all do indeed have the same number of lines).

The command accepts the following options:

-d|--delimiters delimiters, specifies a list of delimiters to use instead of tabs for separating consecutive values on a single line. Each delimiter is used in turn, and when the list has been exhausted, Template:Mono begins again at the first delimiter.
-s|--serial, select to append in serial rather than in parallel; that is, horizontal rather than vertical.

The command was developed for Unix at Bell Labs by Gottfried W. R. Luderer.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref><ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The implementation bundled in GNU coreutils was written by David M. Ihnat and David MacKenzie.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref> The command is available for Windows via UnxUtils.<ref>{{#invoke:citation/CS1|citation |CitationClass=web }}</ref>

ExamplesEdit

For the following examples, Template:Mono is a plain-text file that contains:

Mark Smith
Bobby Brown
Sue Miller
Jenny Igotit

Template:Mono is another plain-text file that contains:

555-1234
555-9876
555-6743
867-5309

The following command joins the two files.

<syntaxhighlight lang="console"> $ paste names.txt numbers.txt Mark Smith 555-1234 Bobby Brown 555-9876 Sue Miller 555-6743 Jenny Igotit 867-5309 </syntaxhighlight>

When invoked with the <syntaxhighlight lang="text" class="" style="" inline="1">--serial</syntaxhighlight> option (<syntaxhighlight lang="text" class="" style="" inline="1">-s</syntaxhighlight> on BSD or older systems), the files are joined horizontally:

<syntaxhighlight lang="console">$ paste --serial names.txt numbers.txt Mark Smith Bobby Brown Sue Miller Jenny Igotit 555-1234 555-9876 555-6734 867-5309</syntaxhighlight>

The use of the <syntaxhighlight lang="text" class="" style="" inline="1">--delimiters</syntaxhighlight> option (<syntaxhighlight lang="text" class="" style="" inline="1">-d</syntaxhighlight> on BSD or older systems) is illustrated in the following example:

<syntaxhighlight lang="console">$ paste --delimiters . names.txt numbers.txt Mark Smith.555-1234 Bobby Brown.555-9876 Sue Miller.555-6743 Jenny Igotit.867-5309</syntaxhighlight>

See alsoEdit

ReferencesEdit

Template:Reflist

External linksEdit

Template:Sister project

  • {{#invoke:citation/CS1|citation

|CitationClass=web }}

Template:Unix commands Template:Core Utilities commands