 |
|  |
 |
|
Comrade Tassadar
|
|
quote: Originally posted by Method
pardon me |
No.
|
|
|  |
 |
|  |
 |
|  |
 |
|  |
 |
|
Kody
|
|
If life's standing still and your soul's confused
Jun 2003 time: 14:35
|
|
Perhaps use this instead of doing it by hand.....
Put all the names and post counts in a file.
Run the script with file containing all the data as the first arguement. It checks for people you've listed twice and adds the post counts together than nicely formats it all.
code:
#!bash
echo Opening File $1 and sorting.
sort $1 | \
awk 'BEGIN{ \
previousname=""; \
postcount=0 \
}\
\
{ \
if (match($1,previousname)) \
postcount=$2+postcount;\
else if (postcount > 0) \
{ \
print previousname "\t" postcount; \
postcount=$2; \
} \
previousname=$1 \
} \
\
END{ \
print previousname "\t" postcount\
}' \
| \
awk '{print $2 "\t" $1}' \
| \
sort -rg \
| \
awk 'BEGIN{total=0}\
{ \
spacing=" ";
for (count=length($2);count<=20;count++) \
spacing=spacing" ";\
print $2 spacing $1;\
total=total+$1;\
}\
END{print "\nTotal Posts: " total}'
|
|
|  |
 |
|
Kody
|
|
If life's standing still and your soul's confused
Jun 2003 time: 14:35
|
|
The beauty of shells scripts is they take a 1/6 of the time to develop. C++ code would be about 3 times longer since you would have to make the sort function, filehandling and string parsing.
|
|
|  |
 |
|
Kody
|
|
If life's standing still and your soul's confused
Jun 2003 time: 14:35
|
|
Happy birthday Micha!
|
|
|  |
All times are GMT. The time now is 05:35. Apolyton Time is 00:35. |
top of page
|
| archivepost |
|
Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is ON
vB code is ON
Smilies are ON
[IMG] code is ON
|
|
|
|
|
|