zoukankan      html  css  js  c++  java
  • paste命令

    paste命令

    join lines of two files on a common field

    join [OPTION]... FILE1 FILE2

    join [-ti12] file1 file2

    示例说明

    ,表明合并的分隔符

    paste -d ',' b.txt m.txt >n.txt

    -表明从标准输入获取文件

    cat b.txt |paste -  m.txt > n.txt

    如果要合并一个文件的所用行

    paste -s b.txt > n.txt

    该命令主要用来将多个文件的内容合并,与cut命令完成的功能刚好相反。

    示例

    $ cat names

    Tony

    Emanuel

    Lucy

    Ralph

    Fred

    gan.cublog.cn

    $ cat numbers

    (307) 555-5356

    (212) 555-3456

    (212) 555-9959

    (212) 555-7741

    (212) 555-0040

    $ paste names numbers   将两个文件合并,他们中间用tab键分隔开

    Tony    (307) 555-5356

    Emanuel (212) 555-3456

    Lucy    (212) 555-9959

    Ralph   (212) 555-7741

    Fred    (212) 555-0040

    $ cat addresses

    55-23 Vine Street, Miami

    39 University Place, New York

    17 E. 25th Street, New York

    38 Chauncey St., Bensonhurst

    17 E. 25th Street, New York

    $ paste names addresses numbers

    Tony    55-23 Vine Street, Miami       (307) 555-5356

    Emanuel 39 University Place, New York  (212) 555-3456

    Lucy    17 E. 25th Street, New York    (212) 555-9959

    Ralph   38 Chauncey St., Bensonhurst   (212) 555-7741

    Fred   17 E. 25th Street, New York     (212) 555-0040

    $ paste -d'+' names addresses numbers   他们中间用指定的'+'符号隔开

    Tony+55-23 Vine Street, Miami+(307) 555-5356

    Emanuel+39 University Place, New York+(212) 555-3456

    Lucy+17 E. 25th Street, New York+(212) 555-9959

    Ralph+38 Chauncey St., Bensonhurst+(212) 555-7741

    Fred+17 E. 25th Street, New York+(212) 555-0040

    $ paste -s names        将多行数据合并到一行,他们间用tab键隔开

    Tony    Emanuel Lucy    Ralph   Fred

    原文

    http://blog.sina.com.cn/s/blog_63d675190100p4wh.html

  • 相关阅读:
    HTML中所用的标签(二)
    HTML中所用的标签(一)
    学习笔记之04表格嵌套练习1
    学习笔记之03百度搜索页面
    学习笔记之02简单的基础
    学习笔记之01程序员起航篇
    Part 53 to 55 Talking about Reflection in C#
    Part 48 to 51 Talking about Access Modifiers in C#
    Part 59 to 60 Difference between Convert ToString and ToString,String and StringBuilder
    Part 57 to 58 Why should you override ToString and Equal Method
  • 原文地址:https://www.cnblogs.com/mydomain/p/3034294.html
Copyright © 2011-2022 走看看