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

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
主站蜘蛛池模板: 政和县| 湘潭市| 措美县| 廉江市| 图木舒克市| 普安县| 中西区| 漾濞| 修水县| 瑞昌市| 洪江市| 三明市| 泰州市| 新巴尔虎左旗| 绥滨县| 平陆县| 永宁县| 儋州市| 南昌县| 高碑店市| 巍山| 漯河市| 叶城县| 分宜县| 繁昌县| 贺兰县| 婺源县| 定结县| 龙口市| 冕宁县| 勃利县| 应城市| 南投县| 平果县| 枣强县| 江西省| 中江县| 锦州市| 通榆县| 阿巴嘎旗| 栾川县|