Convert wc3 Banlist from version 2.8x Text Format (.txt) to new 3.0 XML Format (.xml):
convert wc3 banlist awk script by Stefan Hummert
more about the awk script creators
this is a little script that could help you to convert your old banlist into the new format. In order to use it you need a bit of awk and command line knowledge.
convert wc3 banlist awk script
a little script to convert your old local banlist files to the new XML format of the 3.0 wc3banlist version.
created by Stefan Hummert
last modified 27.11.2007 by Stefan Hummert
GNU GPL
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
Text version: http://www.gnu.org/licenses/gpl.txt
HTML version: http://www.gnu.org/licenses/gpl.html
download:
convert wc3banlist awk script
See more about wc3banlist
#
# Converts wc3 Banlist from version before 3.x (txt Format)
# to the new 3.0 XML Format
# written 11/2007 by Stefan Hummert (Donneker)
#
# this script is to use with awk / gawk
# usage: awk -f convert_wc3_banlist.awk yourbanlist.txt >newFilename.xml
#
#
BEGIN {
print "<?xml version =\"1.0\" encoding=\"UTF-8\"?>"
print "<banlist>"
}
{
nick=$1
time=$7
date=$11
comment=substr($0,length(nick)+2)
if ( index(date,"-") > 4 )
{
date2=substr(date,2,7) "-01"
}
else { date2="2004-01-01" }
if ( index(time,":") < 1 ) { time="00:01:01"; }
if ( comment == "" ) comment="-";
print " <ban nick=\"" nick "\" deleted=\"0\">"
print " <comment>" comment "</comment>"
print " <lastchange>"
print " <date>" date2 "</date>"
print " <time>" time "</time>"
print " </lastchange>"
print "</ban>"
}
END {
print "</banlist>"
}
how to use:
See this Blogpost about the conversion script (post is in german)
First, you have to load your old wc3banlist version 2.8x (or maybe older) and export your bans with the export functionality to a text file. Now you have to get an awk version (e.g. gawk) for your OS. Normal you have to use awk with the command line of your OS in order to call it. If you have problems with that, first use google search before you ask me :-) (ty) Then, after you converted your .txt Banlist with my script into a new XML Banlist, load it with the new version of the wc3banlist tool (3.x) and have fun. Sometimes it could be, that wc3banlist say it cannot load the XML File. In this case, something gone wrong. If you understand XML, its the easiest way to look in the file and try to find the "bug". As far as I know, wc3Banlist needs all entities, there are no optional ones.