File: egg2mirc.awk

package info (click to toggle)
pisg 0.71-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,228 kB
  • ctags: 357
  • sloc: perl: 7,472; xml: 3,144; sed: 169; makefile: 48; tcl: 23; awk: 15
file content (23 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/awk
# Quite fast log format converter (eggdrop->mirc)
# For those channel stat generators that accept only mirc log format
# use: awk -f egg2mirc.awk channel.log > mircformat.log
#
# Gandalf the Grey <gandalf@irc.pl>
# "The Song Remains The Same" - Led Zeppelin
#
/\[..\:..\] <.+>/ {	print $0 
			next }
/\[..\:..\] Action:/ { 	$2="*"
			print $0 
			next }
/\[..\:..\] .+ (.+) joined #/	{	print $1 " *** " $2 " " $3 " has " $4 " " substr($5,1,length($5)-1) 
					next }
/\[..\:..\] .+ (.+) left #/	{	print $1 " *** " $2 " " $3 " has " $4 " " substr($5,1,length($5)-1) 
					next }
/\[..\:..\] .+ (.+) left irc/	{	print $1 " *** " $2 " " $3 " Quit (" $6 "...)" 
					next }
/\[..\:..\] .+ kicked from #/	{	print $1 " *** " $2 " was " $3 " by " substr($7,1,length($7)-1) " (" $8 "...)" 
					next }
/\[..\:..\] #.+\: mode change /	{ if (index($NF,"!")!=0) print $1 " *** " substr($NF,1,index($NF,"!")-1) " sets mode: " substr($0,index($0,"'")+1,length($0)-length($(NF))-index($0,"'")-5) 
					else print $1 " *** " $NF " sets mode: " substr($0,index($0,"'")+1,length($0)-length($(NF))-index($0,"'")-5)}