I have 3 files.
cat file1
A
B
C
cat file2
2
3
4
cat file3
a
b
c
I need to merge them into file like this.
Output:
file1 file2 file3
A 2 a
B 3 b
C 4 c
How can i do in shell script.
Regards
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
pasteis your friendThe
\tare tab-chars, if you want a different field separator, just change that.(If you want nicely spaced columns as the same width as the widest value in a file, then you’ll need a more sophisticated solution. For that case, please post a new question).
Note that
{ ... }is called a process group, and that the last command in a process group must be separated from the closing}char with a;.Check out the man page for a few options.
IHTH