Can I merge-sort two sorted files by using comm?
up vote
0
down vote
favorite
comm assumes its two inputs are sorted. Is it correct that it works in the same way as the merge sort algorithm?
If yes, can I use comm to merge-sort two sorted files?
Thanks.
sort coreutils comm
add a comment |
up vote
0
down vote
favorite
comm assumes its two inputs are sorted. Is it correct that it works in the same way as the merge sort algorithm?
If yes, can I use comm to merge-sort two sorted files?
Thanks.
sort coreutils comm
2
I'd justsort -mu file1 file2
.
– Jeff Schaller
Nov 16 at 21:12
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
comm assumes its two inputs are sorted. Is it correct that it works in the same way as the merge sort algorithm?
If yes, can I use comm to merge-sort two sorted files?
Thanks.
sort coreutils comm
comm assumes its two inputs are sorted. Is it correct that it works in the same way as the merge sort algorithm?
If yes, can I use comm to merge-sort two sorted files?
Thanks.
sort coreutils comm
sort coreutils comm
edited Nov 17 at 1:29
K7AAY
244319
244319
asked Nov 16 at 21:07
Tim
1
1
2
I'd justsort -mu file1 file2
.
– Jeff Schaller
Nov 16 at 21:12
add a comment |
2
I'd justsort -mu file1 file2
.
– Jeff Schaller
Nov 16 at 21:12
2
2
I'd just
sort -mu file1 file2
.– Jeff Schaller
Nov 16 at 21:12
I'd just
sort -mu file1 file2
.– Jeff Schaller
Nov 16 at 21:12
add a comment |
1 Answer
1
active
oldest
votes
up vote
2
down vote
comm
acts like a single merge step of the merge sort algorithm, and further, produces separated output (in different columns), not combined output. Therefore it can't be used to "merge-sort" anything.
New contributor
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
comm
acts like a single merge step of the merge sort algorithm, and further, produces separated output (in different columns), not combined output. Therefore it can't be used to "merge-sort" anything.
New contributor
add a comment |
up vote
2
down vote
comm
acts like a single merge step of the merge sort algorithm, and further, produces separated output (in different columns), not combined output. Therefore it can't be used to "merge-sort" anything.
New contributor
add a comment |
up vote
2
down vote
up vote
2
down vote
comm
acts like a single merge step of the merge sort algorithm, and further, produces separated output (in different columns), not combined output. Therefore it can't be used to "merge-sort" anything.
New contributor
comm
acts like a single merge step of the merge sort algorithm, and further, produces separated output (in different columns), not combined output. Therefore it can't be used to "merge-sort" anything.
New contributor
New contributor
answered Nov 17 at 2:02
JohnDoea
273
273
New contributor
New contributor
add a comment |
add a comment |
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%2f482246%2fcan-i-merge-sort-two-sorted-files-by-using-comm%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
2
I'd just
sort -mu file1 file2
.– Jeff Schaller
Nov 16 at 21:12