Jump to content
  • Advertisement
Sign in to follow this  
Jossnaz

Newbie Question to evaluate a huge logfile

This topic is 3580 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi I'm having a big logfile about 30 MB now I have similar entries to this: main warning: vout synchro warning: pts != current_date (-12267) main warning: vout synchro warning: pts != current_date (-10778) main warning: vout synchro warning: pts != current_date (12733) main warning: vout synchro warning: pts != current_date (-13378) main warning: vout synchro warning: pts != current_date (10500) main debug: decoded 45/108 pictures main warning: vout synchro warning: pts != current_date (-10511) main warning: vout synchro warning: pts != current_date (11667) main warning: vout synchro warning: pts != current_date (-13034) main warning: vout synchro warning: pts != current_date (11311) main warning: vout synchro warning: pts != current_date (11700) main warning: vout synchro warning: pts != current_date (-13411) main warning: vout synchro warning: pts != current_date (15122) main warning: vout synchro warning: pts != current_date (-10711) main warning: vout synchro warning: pts != current_date (10089) main warning: vout synchro warning: pts != current_date (13356) main warning: vout synchro warning: pts != current_date (-10745) main warning: vout synchro warning: pts != current_date (12067) main warning: late picture skipped (3396230) main warning: vout synchro warning: pts != current_date (-13078) main warning: vout synchro warning: pts != current_date (10067) main warning: late picture skipped (3428374) main debug: decoded 97/108 pictures what i want to do is sum the numbers after "main debug: decoded XXX/108" I want to sum over all XXX is there a tool which can do that? is there a way to simply delete everything else? thanks a lot jossi

Share this post


Link to post
Share on other sites
Advertisement
The easiest way I can think of to do this would be to search the entire file for the string "main debug: decoded", and if you find it, you know the next token will be numerical, and the one you want.

As for deleting everything else, you would be best off saving all things you want to keep somewhere in memory, deleting everything in the file, then re-writing it when you are done processing the file.

Share this post


Link to post
Share on other sites
On any linux terminal (including cygwin):

cat logfile|sed 's/^/#/;s%.*decoded \(.*\)/.*%\1%;/#/d'|awk 'BEGIN{i=0}/.*/{i+=$1}END{print i}'

Share this post


Link to post
Share on other sites
I'd say, write a Perl or Python script for it, or use a regular expression to strip all but the numbers you need from the file.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!