That seems like a very long way around a kinda small problem.
All i need is the first comma in the each removed.
Edit: managed it with sed -i 's/,//'
Ok, doesn't quite display the reason correctly as im not sure how to plug binary in from a .csv-like text file but all the same it does work.
Code:
cd /PWServer/logservice/logs
grep -e 'dwAuAGsAMgA1AC4AYwBvAG0APgA' world2.chat > forbid.chat
chmod 777 forbid.chat
sed -i 's/ /,/g' forbid.chat
sed -i 's/=/,/g' forbid.chat
sed -i 's/,,,/,/g' forbid.chat
sed -i 's/,,/,/g' forbid.chat
sed -i 's/msg/100,345600,Autobanned for using k25 hack,32/g' forbid.chat
sed -i 's/,/ /' forbid.chat
mysqlimport -u root --local --force --columns=ctime,@x,@x,@x,@x,@x,@x,userid,@x,@x,type,forbid_time,reason,gmroleid,@x --fields-terminated-by=, dbo forbid.chat
rm forbid.chat
echo "Hackers banned."
Change /PWServer/logservice/logs to your log folder if its not the same.
Change 345600 to the duration to ban for.
Change 32 to the GMroleid you want to name for the ban.
Change dbo to your database name if its not dbo.
Obviously this shouldn't be used by people who don't reset their log files every so often as the log files will just get huge and cause lag when you try to use any script on them.
Enjoy and improve if necessary.