number of different lines in a file
Paul McGuire
ptmcg at austin.rr._bogus_.com
Fri May 19 14:56:53 EDT 2006
"Paddy" <paddy3118 at netscape.net> wrote in message
news:1148063935.859890.173230 at u72g2000cwu.googlegroups.com...
> If the log has a lot of repeated lines in its original state then
> running uniq twice, once up front to reduce what needs to be sorted,
> might be quicker?
>
> uniq log_file | sort| uniq | wc -l
>
> - Pad.
>
Why would the second running of uniq remove any additional lines that
weren't removed in the first pass?
For that matter, if this is a log file, wont every line have a timestamp,
making duplicates extremely unlikely?
-- Paul
More information about the Python-list
mailing list