Program to parse logs...?
- Xavious
- Posts: 2250
- https://www.facebook.com/warszawa.kuchnie.na.wymiar/
- Joined: Sun Jul 13, 2003 7:01 pm
Program to parse logs...?
So i've recorded a log of an in-game meeting in Unreal (Well it was WoW but WoW isn't unreal-related) but it's full of other bumph also... www.edgeways.wowgr.net/filedump/log.txt for an example of what i mean...
Anyone know a program i can use to automatically take out those lines containing [8.hcraids] and [7.edgeways]?
Hehe big problem with WoW is the technical-minded folk are few and far between...
Thanks.
Anyone know a program i can use to automatically take out those lines containing [8.hcraids] and [7.edgeways]?
Hehe big problem with WoW is the technical-minded folk are few and far between...
Thanks.
hm...
you could write a small shell script...
something like that...if you are running a unix-like machine...
(btw: this code doesn't really work and I don't have an idea, why not. log2.txt does not seem to be the problem, comm doesn't seem to do what I want...tell me if you know the bug)
you could write a small shell script...
something like that...if you are running a unix-like machine...
Code: Select all
cat log.txt | egrep KLHTM > log2.txt
comm -23 log.txt log2.txt > finallog.txt
cat finnallog.txt- }TCP{Wolf
- Site Admin
- Posts: 4663
- Joined: Thu Dec 19, 2002 7:30 pm
- Location: https://signal.me/#eu/4zInut2kHeg_ry0GD ... pdqka17o2F
- Contact:
- }TCP{Wolf
- Site Admin
- Posts: 4663
- Joined: Thu Dec 19, 2002 7:30 pm
- Location: https://signal.me/#eu/4zInut2kHeg_ry0GD ... pdqka17o2F
- Contact:
- }TCP{Wolf
- Site Admin
- Posts: 4663
- Joined: Thu Dec 19, 2002 7:30 pm
- Location: https://signal.me/#eu/4zInut2kHeg_ry0GD ... pdqka17o2F
- Contact:
- }TCP{aLICe
- Posts: 1110
- Joined: Thu Mar 20, 2003 5:23 pm
ehhhhhhhh.... to late
BTW: I have seen something like unix-like shell for Win$ - some GPL stuff. Just run it and type one line:
Now you have all lines containing [8.hcraids] or [7.edgeways] in filtered_log_file_name file 
BTW: I have seen something like unix-like shell for Win$ - some GPL stuff. Just run it and type one line:
Code: Select all
grep '\[8.hcraids\]\|\[7.edgeways\]' log_file_name > filtered_log_file_name [ENTER]- }TCP{ZzCaT
- Posts: 1348
- Joined: Fri Dec 20, 2002 8:56 pm
- Location: Tukker Country
Linux is for nerds.}TCP{aLICe wrote:ehhhhhhhh.... to late![]()
BTW: I have seen something like unix-like shell for Win$ - some GPL stuff. Just run it and type one line:Now you have all lines containing [8.hcraids] or [7.edgeways] in filtered_log_file_name fileCode: Select all
grep '\[8.hcraids\]\|\[7.edgeways\]' log_file_name > filtered_log_file_name [ENTER]
ZZ
Well that's what I got, too.}TCP{aLICe wrote:ehhhhhhhh.... to late![]()
BTW: I have seen something like unix-like shell for Win$ - some GPL stuff. Just run it and type one line:Now you have all lines containing [8.hcraids] or [7.edgeways] in filtered_log_file_name fileCode: Select all
grep '\[8.hcraids\]\|\[7.edgeways\]' log_file_name > filtered_log_file_name [ENTER]
But the question was:
The filtered_log_file_name file contains only those lines with 8.hcraids and 7.edgeways.Anyone know a program i can use to automatically take out those lines containing [8.hcraids] and [7.edgeways]?
The opposite is needed, not 8.hcraids-lines are needed but those without 8.hcraids.
That's why I compared the orginal log.txt (contains lines with and without strings like 8.hcraids) with the log2.txt (contains only strings with 8.hcraids).
Code: Select all
comm -23 log.txt log2.txt1. all lines that are log.txt but not in log2.txt
2. all lines that are log2.txt but not in log.txt
3. all lines that are in both files the same.
Only point 1 is needed, therefor I remove others with the option -23
I have no idea why it is not working...
GNU/Linux is for both nerds and non_nerds (although nerds get more adventages)}TCP{ZzCaT wrote:Linux is for nerds.
well on IRC I got another code that workes just fine:
So you can send me the file, too, if you don't have a unix-like machine and do it yourself.
Code: Select all
cat file | perl -e 'while(<>) { /unwantedstring/ || print; } ' > outfile- }TCP{aLICe
- Posts: 1110
- Joined: Thu Mar 20, 2003 5:23 pm
Code: Select all
grep -v 'unwantedstring' > outfilenice}TCP{aLICe wrote:Code: Select all
grep -v 'unwantedstring' > outfile
Sometimes it's easier to read a manpage then to write a script....