Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 05-17-2008, 06:10 PM   #1
Default Help .... How to read a log file using c++...


hello....

I need a c++ code that read a log 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...


EngSara
EngSara is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46