LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Re: perl file processing

[ILUG] Re: perl file processing

Marcus Furlong furlongm at hotmail.com
Wed Oct 8 19:50:04 IST 2008


Francis Daly <francisdaly <at> gmail.com> writes:

[Message truncated to please the gmane web interface]

> If my description above is reasonable, then feeding the file through
> something like
> 
> sed '1,/Stratified cross-validation/d' | sed '1,/Detailed Accuracy By
> Class/d' | sed -e '1,2d' -e '/^$/,$d'
> 
> would be one way of only getting that table you want.
> 
> Sending that through
> 
> awk 'END{print a/NR, b/NR, c/NR, d/NR, e/NR, f/NR} {a+=$1; b+=$2;
> c+=$3; d+=$4; e+=$5; f+=$6}'
> 
> (Not pretty, but effective) will spit out the arithmetic mean of the
> exact numbers logged. You can tweak it to report only appropriate
> significant figures, if needed.
> 
> The processing is fragile because of the assumptions made. But if the
> file format matches, you're sorted.

The assumptions you made were correct.

> 
> If you really want, you could a2p or s2p those to turn them into perl.
> 
> Hope this pushes you in the right direction,

Super, thanks a million! This works perfectly on all the files I've
tested so far.

Marcus.




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell