I have file with some data ~ delimiter
Like :
291207~12:13:12~abcd 112233~aaaaa
291207~12:14:12~abcd 112233~aaaaa
291207~12:14:12~abdf 112233~aaaaa
291207~12:24:12~abdf 112233~bbbb
I want to have on output lines count but only for uniq column 3 , other columns are not important but I want to display all columns for latest lines based on sort for column 2 [ time ]
Something like this :
2 291207~12:24:12~abdf 112233~bbbb
2 291207~12:14:12~abcd 112233~aaaaa
I use some of your code but it is not that what I need:
while(<INLOG>) {
$lines{$_}++;
}
foreach $line (sort keys %lines) {
printf OUTLOG "%7d %s", $lines{$line}, $line;
}
Like :
291207~12:13:12~abcd 112233~aaaaa
291207~12:14:12~abcd 112233~aaaaa
291207~12:14:12~abdf 112233~aaaaa
291207~12:24:12~abdf 112233~bbbb
I want to have on output lines count but only for uniq column 3 , other columns are not important but I want to display all columns for latest lines based on sort for column 2 [ time ]
Something like this :
2 291207~12:24:12~abdf 112233~bbbb
2 291207~12:14:12~abcd 112233~aaaaa
I use some of your code but it is not that what I need:
while(<INLOG>) {
$lines{$_}++;
}
foreach $line (sort keys %lines) {
printf OUTLOG "%7d %s", $lines{$line}, $line;
}