Joining 2 files and excluding word from third file

Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.
I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.
Is there any way to do that with join or should I use awk instead?
file1:
A la
B lb
C lc
D something
file 2:
A ba
B bb
C another
D bd
exl:
something
nothing
result:
A la ba
B lb bb
C lc
D bd
I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt
bash awk join
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.
I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.
Is there any way to do that with join or should I use awk instead?
file1:
A la
B lb
C lc
D something
file 2:
A ba
B bb
C another
D bd
exl:
something
nothing
result:
A la ba
B lb bb
C lc
D bd
I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt
bash awk join
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.
I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.
Is there any way to do that with join or should I use awk instead?
file1:
A la
B lb
C lc
D something
file 2:
A ba
B bb
C another
D bd
exl:
something
nothing
result:
A la ba
B lb bb
C lc
D bd
I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt
bash awk join
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I have three files: file1, file2 and exl. Both file1 and file2 have two columns of content. The first column is the same in both files.
I want to join the content of both files using that column. That's easy using the join command. But there is a problem with the exl file: it contains some words, which I want the join command to ignore/delete.
Is there any way to do that with join or should I use awk instead?
file1:
A la
B lb
C lc
D something
file 2:
A ba
B bb
C another
D bd
exl:
something
nothing
result:
A la ba
B lb bb
C lc
D bd
I found this command on the internet and it does the work but I don't undestand how it works: sed -ie "$(sed 's:.*:s/&//ig:' exl.txt)" file2.txt
bash awk join
bash awk join
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked 3 mins ago
Hammam Boutafant
1
1
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hammam Boutafant is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.
Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.
Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.
Hammam Boutafant is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f476579%2fjoining-2-files-and-excluding-word-from-third-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password