hi....
I need a c++ code that read a log ( Contains numbers and letters) file and compute the average....
This is a sample of the log file....
**********************************************************
Input vector # 99:
OUTPUT: 0 1 0 1 0
**** Vdd = 1.8 **** Tclk = 0.1 ****
SER(FIT): 1.1e-002 1.1e-002 1.9e-002 1.1e-002 5.2e-003
**********************************************************
Input vector # 100:
OUTPUT: 0 1 1 0 0
**** Vdd = 1.8 **** Tclk = 0.1 ****
SER(FIT): 7.6e-003 1.3e-002 1.2e-002 1.5e-002 5.2e-003
I need to compute the horizontal sum of the SER(FIT)values and then compute the average of the sums....
i.e( I want to compute [1.1e-002 + 1.1e-002 +1.9e-002 + 1.1e-002 + 5.2e-003] for each input vector and then compute the average of the sums)...
I can't read the output file and convert the string to a number (since it contains numbers & letters). Instead, I should read the number, then check (using a for loop) where is the position of the letter 'e', and finally construct the number from the string by multiplying the number before the letter 'e' with 10^(number after letter 'e')...
So HOW i could do this?!!
Thanks in advance...