adding contents with multiple files using awk, sed or grep Unicorn Meta Zoo #1: Why another...
Marquee sign letters
Was Objective-C really a hindrance to Apple software development?
Philosophers who were composers?
Retract an already submitted Recommendation Letter (written for an undergrad student)
Why doesn't the university give past final exams' answers?
Does Prince Arnaud cause someone holding the Princess to lose?
What's parked in Mil Moscow helicopter plant?
/bin/ls sorts differently than just ls
Why did Europeans not widely domesticate foxes?
Married in secret, can marital status in passport be changed at a later date?
Coin Game with infinite paradox
How to keep bees out of canned beverages?
Test if all elements of a Foldable are the same
Is there a verb for listening stealthily?
Where to find documentation for `whois` command options?
What is the evidence that custom checks in Northern Ireland are going to result in violence?
What was Apollo 13's "Little Jolt" after MECO?
Why do people think Winterfell crypts is the safest place for women, children & old people?
What to do with someone that cheated their way though university and a PhD program?
When I export an AI 300x60 art board it saves with bigger dimensions
TV series episode where humans nuke aliens before decrypting their message that states they come in peace
Raising a bilingual kid. When should we introduce the majority language?
How was Lagrange appointed professor of mathematics so early?
Why isn't everyone flabbergasted about Bran's "gift"?
adding contents with multiple files using awk, sed or grep
Unicorn Meta Zoo #1: Why another podcast?
Announcing the arrival of Valued Associate #679: Cesar Manara
2019 Community Moderator Election Results
Why I closed the “Why is Kali so hard” questioncompare two files get identical listComparing two files using awk languageUsing sed / awk to change words between two patternsselect multi-column rows based on ranges specified in a separate fileAdding Contents of multiple files using awkUsing sed to clean up long paths in log filesSED/AWK: Add a string to multiple files matched by regex value from another source fileReplace a pattern in File1 and replace it with corresponding matched pattern + column in File2Remove specific columns from csv using awkprocessing multiple files with awk problem
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have to files named file 1 and filed 2 following format:
file 1 with 18000 lines
COL1 COL2 COL3 COL4 COL5
- . ID = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 2 Parent = tom_fa_10005086
- 1 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
+ . ID = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
- . ID = tom_fa_10000024
- 0 Parent = tom_fa_10000024
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
and file 2
COL 1 COL 2
tom_fa_10005086 ABI3VP1
tom_fa_10013928 ABI3VP2
tom_fa_10000024 Alfin-like
tom_fa_10011338 C2C2-Dof
tom_fa_10003474 C2C2-Gata
tom_fa_10003291 C2H2
tom_fa_10007064 C2H2
tom_fa_10008972 C2H2
tom_fa_10009025 C2H2
tom_fa_10005726 C3H
tom_fa_10011317 C3H
tom_fa_10010708 CPP
tom_fa_10002138 E2F-DP
tom_fa_10009443 G2-like
tom_fa_10008970 GRAS
I want to do if colum 5 ( file 1) and colum 1 (file 2) are equal, add at a colum 6 in file 2 corresponding with col 2 (file)
so it would look like
- . ID = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 2 Parent = tom_fa_10005086 ABI3VP1
- 1 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
+ . ID = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
- . ID = tom_fa_10000024 Alfin-like
- 0 Parent = tom_fa_10000024 Alfin-like
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
I tried with fgrep -f file 2 file1 but i don't know how to merge the information of the colum 2 file 2. and the strings are no equal.
bash shell-script awk sed terminal
New contributor
add a comment |
I have to files named file 1 and filed 2 following format:
file 1 with 18000 lines
COL1 COL2 COL3 COL4 COL5
- . ID = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 2 Parent = tom_fa_10005086
- 1 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
+ . ID = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
- . ID = tom_fa_10000024
- 0 Parent = tom_fa_10000024
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
and file 2
COL 1 COL 2
tom_fa_10005086 ABI3VP1
tom_fa_10013928 ABI3VP2
tom_fa_10000024 Alfin-like
tom_fa_10011338 C2C2-Dof
tom_fa_10003474 C2C2-Gata
tom_fa_10003291 C2H2
tom_fa_10007064 C2H2
tom_fa_10008972 C2H2
tom_fa_10009025 C2H2
tom_fa_10005726 C3H
tom_fa_10011317 C3H
tom_fa_10010708 CPP
tom_fa_10002138 E2F-DP
tom_fa_10009443 G2-like
tom_fa_10008970 GRAS
I want to do if colum 5 ( file 1) and colum 1 (file 2) are equal, add at a colum 6 in file 2 corresponding with col 2 (file)
so it would look like
- . ID = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 2 Parent = tom_fa_10005086 ABI3VP1
- 1 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
+ . ID = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
- . ID = tom_fa_10000024 Alfin-like
- 0 Parent = tom_fa_10000024 Alfin-like
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
I tried with fgrep -f file 2 file1 but i don't know how to merge the information of the colum 2 file 2. and the strings are no equal.
bash shell-script awk sed terminal
New contributor
(1) “add a column 6 in file 2” — but file 2 has only two columns. Do you want to add columns 3, 4 and 5? (2) Look atjoin
.
– G-Man
3 hours ago
Have you looked at thejoin
command? It will join lines of two files based on a shared field.
– Jeff H.
3 hours ago
add a comment |
I have to files named file 1 and filed 2 following format:
file 1 with 18000 lines
COL1 COL2 COL3 COL4 COL5
- . ID = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 2 Parent = tom_fa_10005086
- 1 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
+ . ID = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
- . ID = tom_fa_10000024
- 0 Parent = tom_fa_10000024
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
and file 2
COL 1 COL 2
tom_fa_10005086 ABI3VP1
tom_fa_10013928 ABI3VP2
tom_fa_10000024 Alfin-like
tom_fa_10011338 C2C2-Dof
tom_fa_10003474 C2C2-Gata
tom_fa_10003291 C2H2
tom_fa_10007064 C2H2
tom_fa_10008972 C2H2
tom_fa_10009025 C2H2
tom_fa_10005726 C3H
tom_fa_10011317 C3H
tom_fa_10010708 CPP
tom_fa_10002138 E2F-DP
tom_fa_10009443 G2-like
tom_fa_10008970 GRAS
I want to do if colum 5 ( file 1) and colum 1 (file 2) are equal, add at a colum 6 in file 2 corresponding with col 2 (file)
so it would look like
- . ID = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 2 Parent = tom_fa_10005086 ABI3VP1
- 1 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
+ . ID = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
- . ID = tom_fa_10000024 Alfin-like
- 0 Parent = tom_fa_10000024 Alfin-like
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
I tried with fgrep -f file 2 file1 but i don't know how to merge the information of the colum 2 file 2. and the strings are no equal.
bash shell-script awk sed terminal
New contributor
I have to files named file 1 and filed 2 following format:
file 1 with 18000 lines
COL1 COL2 COL3 COL4 COL5
- . ID = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 2 Parent = tom_fa_10005086
- 1 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
- 0 Parent = tom_fa_10005086
+ . ID = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 0 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 1 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
+ 2 Parent = tom_fa_10013928
- . ID = tom_fa_10000024
- 0 Parent = tom_fa_10000024
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
and file 2
COL 1 COL 2
tom_fa_10005086 ABI3VP1
tom_fa_10013928 ABI3VP2
tom_fa_10000024 Alfin-like
tom_fa_10011338 C2C2-Dof
tom_fa_10003474 C2C2-Gata
tom_fa_10003291 C2H2
tom_fa_10007064 C2H2
tom_fa_10008972 C2H2
tom_fa_10009025 C2H2
tom_fa_10005726 C3H
tom_fa_10011317 C3H
tom_fa_10010708 CPP
tom_fa_10002138 E2F-DP
tom_fa_10009443 G2-like
tom_fa_10008970 GRAS
I want to do if colum 5 ( file 1) and colum 1 (file 2) are equal, add at a colum 6 in file 2 corresponding with col 2 (file)
so it would look like
- . ID = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 2 Parent = tom_fa_10005086 ABI3VP1
- 1 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
- 0 Parent = tom_fa_10005086 ABI3VP1
+ . ID = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 0 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 1 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
+ 2 Parent = tom_fa_10013928 ABI3VP2
- . ID = tom_fa_10000024 Alfin-like
- 0 Parent = tom_fa_10000024 Alfin-like
- . ID = tom_fa_10004587
- 0 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
- 1 Parent = tom_fa_10004587
+ . ID = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 2 Parent = tom_fa_10018753
+ 0 Parent = tom_fa_10018753
+ . ID = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 0 Parent = tom_fa_10007441
+ 1 Parent = tom_fa_10007441
+ 2 Parent = tom_fa_10007441
I tried with fgrep -f file 2 file1 but i don't know how to merge the information of the colum 2 file 2. and the strings are no equal.
bash shell-script awk sed terminal
bash shell-script awk sed terminal
New contributor
New contributor
New contributor
asked 4 hours ago
Juliana B CJuliana B C
1
1
New contributor
New contributor
(1) “add a column 6 in file 2” — but file 2 has only two columns. Do you want to add columns 3, 4 and 5? (2) Look atjoin
.
– G-Man
3 hours ago
Have you looked at thejoin
command? It will join lines of two files based on a shared field.
– Jeff H.
3 hours ago
add a comment |
(1) “add a column 6 in file 2” — but file 2 has only two columns. Do you want to add columns 3, 4 and 5? (2) Look atjoin
.
– G-Man
3 hours ago
Have you looked at thejoin
command? It will join lines of two files based on a shared field.
– Jeff H.
3 hours ago
(1) “add a column 6 in file 2” — but file 2 has only two columns. Do you want to add columns 3, 4 and 5? (2) Look at
join
.– G-Man
3 hours ago
(1) “add a column 6 in file 2” — but file 2 has only two columns. Do you want to add columns 3, 4 and 5? (2) Look at
join
.– G-Man
3 hours ago
Have you looked at the
join
command? It will join lines of two files based on a shared field.– Jeff H.
3 hours ago
Have you looked at the
join
command? It will join lines of two files based on a shared field.– Jeff H.
3 hours ago
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Juliana B C 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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f514140%2fadding-contents-with-multiple-files-using-awk-sed-or-grep%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Juliana B C is a new contributor. Be nice, and check out our Code of Conduct.
Juliana B C is a new contributor. Be nice, and check out our Code of Conduct.
Juliana B C is a new contributor. Be nice, and check out our Code of Conduct.
Juliana B C is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f514140%2fadding-contents-with-multiple-files-using-awk-sed-or-grep%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
(1) “add a column 6 in file 2” — but file 2 has only two columns. Do you want to add columns 3, 4 and 5? (2) Look at
join
.– G-Man
3 hours ago
Have you looked at the
join
command? It will join lines of two files based on a shared field.– Jeff H.
3 hours ago