官术网_书友最值得收藏!

The join command

Consider two files, namely one.txt and two.txt:

  • The content of one.txt is as follows:
1 India 
2 UK 
3 Canada 
4 US 
5 Ireland 
  • The content of two.txt is as follows:
1 New Delhi 
2 London 
3 Toronto 
4 Washington 
5 Dublin 

In this case, for both the files, the common fields are the fields that have serial numbers that are the same in both files. We can combine both files using the following command:

    $ join one.txt two.txt

The output will be as follows:

    1 India New Delhi
    2 UK London
    3 Canada Toronto
    4 US Washington
    5 Ireland Dublin
主站蜘蛛池模板: 灌云县| 横峰县| 长治市| 涟水县| 井陉县| 安化县| 德阳市| 伊宁县| 平舆县| 东光县| 莱芜市| 巢湖市| 太白县| 海淀区| 樟树市| 中山市| 秀山| 邳州市| 名山县| 柞水县| 磐石市| 德兴市| 北海市| 松潘县| 革吉县| 昌黎县| 奉新县| 包头市| 乐陵市| 平邑县| 沈阳市| 出国| 阿克| 商都县| 忻州市| 永靖县| 德昌县| 东明县| 延长县| 茌平县| 山阳县|