# Function for skipping header
function skip_header()
{
do
getline txt ;
while ( length(txt) > 0 )
return
}
# First skip header
BEGIN {
skip_header()
reply_lines = 0;
new_lines = 0;
empty_lines = 0;
replies = 0;
signatures = 0;
}
END {
print "Reply lines: " reply_lines;
print "New lines: " new_lines;
print "Empty lines: " empty_lines;
print "Replies : " replies;
print "Signatures : " signatures;
}
# Empty lines
/^$/ {
empty_lines++;
next;
}
# Reply to somebody
#On Wed, Jan 23, 2002 at 10:18:27AM +0100, klokan wrote:
/^On \(Mon|Tue|Wed|Thu|Fri|Sat|Sun\)\(.*\) wrote:$/ {
replies++;
next;
}
# Text in reply
/^> / {
reply_lines++;
next;
}
# Counter for signatures from haluze
/http:\/\/www\.Haluze\.sk/ {
signatures++;
next;
}
# Normal text
{
new_lines++;
# print NR " " $0
next;
}
# vim: set autoindent
Platon Group <platon@platon.org> http://platon.org/
|