In Linux, text files are merged by column-Linux general technology-Linux programming and kernel information. For details, refer to the following section. I want to combine the file1 and file2 of a text file into a file file3 according to the corresponding rows. As follows:
At the beginning, I used VIM to implement the VI advanced command collection and VIM application instances, but it was quite troublesome. After exploration, I found that using the paste command to implement this function is relatively simple, and using the paste file1 file2> file3 command to solve the problem.
The following describes how to use paste:
1. syntax structure: paste [OPTION]... [FILE]...
2. option can be the following parameter:
-D, -- delimiters = LIST: each row is separated by a specified character.
-S, -- serial: horizontally arrange the first file, and then horizontally arrange the second file...
-- Help: displays help
-- Version: displays the version number.
3. There can be multiple files. We can merge multiple files at the same time. For example, paste file1 file2 file3 can merge three files at the same time.
The above are just some tips I have found during the use of linux and hope to help you.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.