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

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
主站蜘蛛池模板: 沙田区| 双桥区| 隆安县| 通河县| 肇庆市| 鹤庆县| 盈江县| 高要市| 温州市| 灵璧县| 依兰县| 泗洪县| 太仆寺旗| 嘉善县| 吐鲁番市| 临夏市| 会同县| 肥乡县| 巴塘县| 庆城县| 宁津县| 温宿县| 高唐县| 连州市| 邯郸市| 内黄县| 呼图壁县| 太白县| 上杭县| 宕昌县| 桦甸市| 龙海市| 纳雍县| 西盟| 顺平县| 长垣县| 八宿县| 涿鹿县| 阿城市| 湖北省| 册亨县|