Jump to content

The million Dollar question (Math Que)


dorit30
 Share

Recommended Posts

Hello, maybe its simple question but plz do not hurry to answer

I got $Table that contain a random list of numbers that can be 1 lets say to 200 (Only integers) and every 1 DAY the list is change and write to another file xx12-07.txt xx13-07.txt enc.

Now i need to collect the numbers and addition together AND total sum them to got the average of this Hour ( 2 , 4, 8, = 14 ) and the average is 4.6 per hour and show in the results : the table , the total sum , and the Hour average

second i need average per day and per month

How to collect the Last file its easy : Dir x:\xxx /b > 1.txt then Readline and the last line its the goal so i always got the last hour

Im stuck in how i can export the $Table into "WhateveR" and addition only the numbers and then total sum and get the average. i cant find the command that do the job or the right formula i read again and again the help files tutorial but maybe cause i am female :):) its run away from me

guys its your turn now

Link to comment
Share on other sites

I am not sure to understand your problem, but if you want to sum all the numbers in an array and then get the average of them, then :

$array_size = ... (if you do not know the size of your array, you will have to find it out)
$sum = 0
$i = 0
While $i < $array_size
    $sum = $sum + $array[$i]
    $i = $i + 1
Wend
$average = $sum / $array_size
Edited by Just1f
Link to comment
Share on other sites

I am not sure to understand your problem, but if you want to sum all the numbers in an array and then get the average of them, then :

$array_size = ... (if you do not know the size of your array, you will have to find it out)
$sum = 0
$i = 0
While $i < $array_size
    $sum = $sum + $array[$i]
        $i = $i + 1
Wend
$average = $sum / $array_size
$array_size = ... (if you do not know the size of your array, you will have to find it out)-->THIS IS THE PROBLAM !!

its the way to make average and i know how to do this

i need to get from the Table the numbers then sum and in the end do the average:

the Table = 2, 3, 6, ... Sum them 2+3+6 = 11 and then average = 3.6 i dont post for that

What i need this in FORMULA with variables !!

1 i dont know how much numbers in the table it has to be variable

2 i need to sum them and get the result

3 if i made an average dont forget i got zero in my table : 1 + 0 +3 = its not / 3 its /2 cause 0 cant be include in average if i use @extended

Link to comment
Share on other sites

Any 1 ??

the answer is: 42

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

Link to comment
Share on other sites

If you need more help, post sample content for the data file, with only 10 lines or so, and the code you have so far to interpret it.

The size of an array is determined with Ubound(). Look it up in the help file.

Reading a file into an array to manipulate it one line at a time is done with _FileReadToArray(). Look it up in the help file.

Math operators for AutoIt are listed under "Operators". Look it up in the help file.

While you're at it, you might take some time to peruse.... the help file.

:)

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

If you need more help, post sample content for the data file, with only 10 lines or so, and the code you have so far to interpret it.

The size of an array is determined with Ubound(). Look it up in the help file.

Reading a file into an array to manipulate it one line at a time is done with _FileReadToArray(). Look it up in the help file.

Math operators for AutoIt are listed under "Operators". Look it up in the help file.

While you're at it, you might take some time to peruse.... the help file.

:)

The problem resolve here : http://www.autoitscript.com/forum/index.php?showtopic=64228

and i did peruse.... the help file and the UDF and search the data base and google enc..

But as you know i fall on the little things

bye

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...