comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Oooh...! It's harder than I thought!! To get average of each line using only meaningful data
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Oooh...! It's harder than I thought!! To get average of each line using only meaningful data [message #54956] Tue, 24 July 2007 00:33
kim20026 is currently offline  kim20026
Messages: 54
Registered: November 2006
Member
G'day, Everyone!!!

I have a big data file (24*27720) . The file was minimized as
following.

test00.txt
0 2 4 6 7 0
0 0 3 3 2 0
1 2 3 4 5 0
0 0 0 1 2 0

I need to get the average of each line.
For example, I have 4 meaningful data in the first line. In this case
I want to have 4.75 (19/4) instead of 3.167 (19/6).

To do this
1. I need to get the number of meaningful data, n, in each line first.
2. summation of each line, sum.
3. sum/n..., and then print to output.txt
That's all I need. I believe I can handle step 2 and 3, but step 1 is
harder than I thought...

Please give me any suggestions. Thank you !!!

Harry
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: i386 v6.3 MacOSX: cursor.pro not responding to mouse button events
Next Topic: Re: Why the default set is 'XSTYLE=0, YSTYLE=0'

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 19:10:39 PDT 2025

Total time taken to generate the page: 0.16211 seconds