Using Sed on Log files having trouble.
hello guys,
im trying to use the unix command Sed, but im having no luck
so far it seems only when i use the special characters in the log files it reads them as delimiters or just doesnt read them at all
if youve ever read the logs you know they are far from english and i was wondering is there any libraries that i can find to help make sed read the special characters? im mostly doing this as one big script to help people understand the logs more and make it easier to read.
my ideas was to cd /pwserver/logservice/world2.log
then look for everything players do and change them to english so it will read
a player enters crafting service
Óû§48»¨µô½ðÇ®0
blue meaning action, red meaning player and green meaning crafting
and so on
its pretty simple and im sure will help some of the comunity or even the better devs help understand that a player did this or if they were to try to dupe or something else. ive adopted the idea of sed from Robbie so ill give credit to him for that post that helped me discover the power of sed.
Re: Using Sed on Log files having trouble.
If you mean it's just giving your characters that don't make any sense, then that is because it is formatted as GB2312. Use iconv after you get the specific text you want.
To be perfectly honest though Perl was made because of all the ridiculous workarounds you had to do in shell script to parse text. I'd really suggest using something higher level then shell script for text parsing as unless you are familiar with shell script it can be difficult to get anything done.
(The fact that simple, innocent, looking things such as :(){ :|:& };: (don't even try running this, it's a fork bomb. You've been warned) can totally end up overwhelming your system usually doesn't help either)
Re: Using Sed on Log files having trouble.
thanks das i will look into it.
Re: Using Sed on Log files having trouble.
Yeah I would reccomend not using shell scripts :)
Wish I could be a bit more useful but I have never really looked into the issue... But goodluck
Posted via Mobile Device
Re: Using Sed on Log files having trouble.
hey, its fine im looking at perl now and i gotta say its a pretty nice language to write in, easy syntax to understand and it feels right, when i finish this I'll release it i dont know who it will help but im sure someone will find use for it or maybe even expand it even more.