Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux uses join-A1 to merge two files

2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

To merge the following two files, merge them together into 1.txt

# 1.txtJerry 20Alice 30David 40# 2.txtJerry manAlice womanDavid 40

Merged 1.txt

Jerry 20 man

Alice 30 woman

David 40

If the characteristics of the above files are the same, they will be merged, and the second column lacks content. This time the use of join-A1 1.txt 2.txt can be very good to achieve the goal.

[root@host ~] # join-A1 1.txt 2.txtJerry 20 manAlice 30 womanDavid 40mura: in addition to displaying the matching lines, display the matching lines in the specified serial number (1 or 2) file-1: match with the FIELD field in file1

Summary

The above is the whole content of this article. I hope the content of this article has a certain reference and learning value for everyone's study or work. Thank you for your support. If you want to know more about it, please see the relevant links below.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report