From owner-freebsd-questions@FreeBSD.ORG Tue Aug 3 19:41:42 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B33B106566B for ; Tue, 3 Aug 2010 19:41:42 +0000 (UTC) (envelope-from dino_vliet@yahoo.com) Received: from web51104.mail.re2.yahoo.com (web51104.mail.re2.yahoo.com [206.190.38.146]) by mx1.freebsd.org (Postfix) with SMTP id 3F0D38FC1D for ; Tue, 3 Aug 2010 19:41:41 +0000 (UTC) Received: (qmail 74094 invoked by uid 60001); 3 Aug 2010 19:15:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1280862900; bh=UlCEz5ewIVBRjRkFPfto4eRbxrQn9Ldd19YPEhCRD/g=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=IPc5at0ywEfDS73Da6x/Eb8Xq32LPC9b8Vb6VqOZeOUe19mOiE/sDzo14Tcw+L4ekSiXC4XRWStRRYCS+usKdnTLAN5DHLJ/PPr4qER8cLSMJoTwR1/pLntsI6H4WbDBlGRBud+hRkLlep5o4wcFgWnt8VF1Ea2ej4SZn9zknHQ= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=f7dGZQGP7FlR9fOQ3s04WAT9Nb3B2X72JS6hq0XulyD/m/EAq3E9v481LpvU9Z+4Cfely2W+RYQ8wcLrCVbNaTTsgdbovLDlqYfkt07xcw0qd61B4wSrJ1JZLsADdz0rT2uF4qFqVcTkxwAODJs9afou+p33lUvwNUU9lf6Ovd0=; Message-ID: <988913.74048.qm@web51104.mail.re2.yahoo.com> X-YMail-OSG: wRBlaGoVM1krSpXP4bgbyC22l3pOBro6L36K7mvj.OPP4Ru iavFd2CFmJYJnMhEkdrZp62Hl4sbwvitycxj.MWsgdYiS.hm.OXUkdfJOHJB jmP8JecLb7ZqPS9d7ZGX_SP3JynZc.VWmq8PVO49brJ1xj.BiXBzn_I4anuJ 7G6P13NntHgmC6_Yb07jTepu0t_hju643MzW53.Nv8tR0JhbaC_lWCsleqZB oVL5qWCRiR.MKxcvzsPiEq2qGKWXWOpptkCTsTKAPKhw_21xIc9U9kUCvWMR wVtcbrTEp15Uawe2PCcpnMvd21Q-- Received: from [85.144.145.49] by web51104.mail.re2.yahoo.com via HTTP; Tue, 03 Aug 2010 12:14:59 PDT X-Mailer: YahooMailClassic/11.2.4 YahooMailWebService/0.8.105.279950 Date: Tue, 3 Aug 2010 12:14:59 -0700 (PDT) From: Dino Vliet To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: how to parse output of application? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Aug 2010 19:41:42 -0000 Dear freebsd list, Can you help me with this task I have? I have a lot of files in a subdirect= ory containing the following text: Correctly Classified Instances=A0=A0=A0=A0 3018117=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0 56.6808 % Incorrectly Classified Instances=A0=A0 2306643=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 43.3192 % Kappa statistic=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0 0.2443 Mean absolute error=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0 0.4304 Root mean squared=0A error=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0 0.4586 Relative absolute error=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 124.12= 51 % Root relative squared error=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 110.1308 % Total Number of Instances=A0=A0=A0=A0=A0=A0=A0=A0=A0 5324760=A0=A0=A0=A0=20 =3D=3D=3D Detailed Accuracy By Class =3D=3D=3D TP Rate=A0=A0 FP Rate=A0=A0 Precision=A0=A0 Recall=A0 F-Measure=A0=A0 ROC A= rea=A0 Class =A0 0.618=A0=A0=A0=A0 0.343=A0=A0=A0=A0=A0 0.681=A0=A0=A0=A0 0.618=A0=A0=A0= =A0 0.648=A0=A0=A0=A0=A0 0.697=A0=A0=A0 1 =A0 0.519=A0=A0=A0=A0 0.244=A0=A0=A0=A0=A0 0.617=A0=A0=A0=A0=0A 0.519=A0=A0= =A0=A0 0.564=A0=A0=A0=A0=A0 0.693=A0=A0=A0 2 =A0 0.296=A0=A0=A0=A0 0.141=A0=A0=A0=A0=A0 0.056=A0=A0=A0=A0 0.296=A0=A0=A0= =A0 0.094=A0=A0=A0=A0=A0 0.66=A0=A0=A0=A0 3 =3D=3D=3D Confusion Matrix =3D=3D=3D =A0=A0=A0=A0=A0=A0 a=A0=A0=A0=A0=A0=A0 b=A0=A0=A0=A0=A0=A0 c=A0=A0 <-- clas= sified as =A01784321=A0 684983=A0 416649 |=A0=A0=A0=A0=A0=A0 a =3D 1 =A0 787342 1190428=A0 314537 |=A0=A0=A0=A0=A0=A0 b =3D 2 =A0=A0 49255=A0=A0 53877=A0=A0 43368 |=A0=A0=A0=A0=A0=A0 c =3D 3 I need to parse this file to get in a csv file the following information: Correctly Classified Instances, Kappa statistic, Total Number of Instances,= Precision {1}, Recall {1}, F-Measure=0A {1},Precision {2}, Recall {2}, F-M= easure {2},Precision {3}, Recall {3}, F-Measure {3},a,b,c,a,b,c,a,b,c 56.6808,=0A 0.2443, 5324760, 0.681,0.618,0.648,0.617,0.519,0.564, =0A0.056,= 0.296,0.094,1784321,684983,416649,787342,1190428,314537,49255,53877,43368 Does anyone have an idea how this could be accomplished? I not that great in programming so writing a ruby or shell script do do thi= s would take me weeks:-( Thanks Dino=0A=0A=0A