How to Aggregate and get group count in specific column from text file by perl?Parsing a text-file table and...
How can I check type T is among parameter pack Ts... in C++?
What is the olden name for sideburns?
Professor Roman gives unusual math quiz ahead of
Wilcoxon signed rank test – critical value for n>50
Do 3D printers really reach 50 micron (0.050mm) accuracy?
Is there a short way to check uniqueness of values without using 'if' and multiple 'and's?
Could Sauron have read Tom Bombadil's mind if Tom had held the Palantir?
Children's short story about material that accelerates away from gravity
Row to remove the dotted white border around focused button text
MH370 blackbox - is it still possible to retrieve data from it?
What speedlites can work with the Canon EOS 4000D's non-standard hotshoe?
Golf the smallest circle!
Would adding an external lens allow one area outside the focal plane to be in focus?
Why is the Turkish president's surname spelt in Russian as Эрдоган, with г?
Was touching your nose a greeting in second millenium Mesopotamia?
Why is the divergence of this series apparently not predicted by the Monotonic Sequence Theorem?
Are there any vegetarian astronauts?
Does anycast addressing add additional latency in any way?
Three column layout
Why is Bézout's identity considered an identity?
How to write or read powers (math) by words?
Procedurally generate regions on island
Does the UK have a written constitution?
Is there any set of 2-6 notes that doesn't have a chord name?
How to Aggregate and get group count in specific column from text file by perl?
Parsing a text-file table and aggregating informationHow to grep for text in a file and display the paragraph that has the text?extract the 4th column from a csv file using unix commandHandling dynamically changing column positions and splitting fileGroup words based on the value of the first columnHow to print incremental count of occurrences of unique values in column 1Taking numbers from a text file and add them togetherHow to select rows with minimum value in each group based on first column as ID?how insert column of same number in text file?Getting a row data from matching column in CSV file in Perl?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}
I have a big text file(with 15 lines) in this format (srip dip sport dport .....)
I would like to group distinct first column and get the group counts,
input file:
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.3 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.4 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
I want to get output file like as below,
10.10.10.1 2
10.10.10.3 1
10.10.10.4 1
How can I do this?
perl group
New contributor
add a comment |
I have a big text file(with 15 lines) in this format (srip dip sport dport .....)
I would like to group distinct first column and get the group counts,
input file:
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.3 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.4 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
I want to get output file like as below,
10.10.10.1 2
10.10.10.3 1
10.10.10.4 1
How can I do this?
perl group
New contributor
add a comment |
I have a big text file(with 15 lines) in this format (srip dip sport dport .....)
I would like to group distinct first column and get the group counts,
input file:
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.3 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.4 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
I want to get output file like as below,
10.10.10.1 2
10.10.10.3 1
10.10.10.4 1
How can I do this?
perl group
New contributor
I have a big text file(with 15 lines) in this format (srip dip sport dport .....)
I would like to group distinct first column and get the group counts,
input file:
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.1 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.3 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
10.10.10.4 10.10.66.150 60761 502 2019-02-28 13:30:31.447 0 6 ....S. 0 1 44 1 cluster1
I want to get output file like as below,
10.10.10.1 2
10.10.10.3 1
10.10.10.4 1
How can I do this?
perl group
perl group
New contributor
New contributor
New contributor
asked 11 mins ago
georgetovreageorgetovrea
1
1
New contributor
New contributor
add a comment |
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
});
}
});
georgetovrea 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%2f526547%2fhow-to-aggregate-and-get-group-count-in-specific-column-from-text-file-by-perl%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
georgetovrea is a new contributor. Be nice, and check out our Code of Conduct.
georgetovrea is a new contributor. Be nice, and check out our Code of Conduct.
georgetovrea is a new contributor. Be nice, and check out our Code of Conduct.
georgetovrea 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%2f526547%2fhow-to-aggregate-and-get-group-count-in-specific-column-from-text-file-by-perl%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