Simple Linux Command Line notes: Paste

Source: Internet
Author: User
ArticleDirectory
    • Parameters
    • Option
    • Example

Connect the corresponding lines of the file

Paste [Option] [File-list]

 

Paste reads rows from file-list, connects the corresponding rows, and outputs them. By default, the output rows are separated by tabs.

 

Parameters

File-listIs the file name list.File-list,PasteThe input will be retrieved from the standard input

 

Option

-D Dlist is a list of characters used to separate output fields. If Dlist contains only one character, paste replaces the default tab with this character to separate fields.

If a Dlist contains multiple characters, these characters are used in turn to separate output fields.

-S: processes a file at a time and connects horizontally.

 

Example

Original file

 
$CatA.txt AAAA bbbbaaaa BBBB $CatB .txt CCCC ddddcccc dddd

 

Paste
 
$ Paste a.txt B .txt AAAA BBBB CCCC ddddaaaa BBBB CCCC dddd

Lines are separated by tabs by default.

 

Paste-d
 
$ Paste-D =A.txt B .txt AAAA BBBB=CCCC ddddaaaa BBBB= CCCC dddd

Specify delimiter connection line

 

Paste-S
 
$ Paste-S a.txt B .txt AAAA BBBB AAAA bbbbcccc dddd CCCC dddd

Horizontally connected rows

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.