Help .... How to read a log file using c++...

Discussion in 'Software' started by EngSara, May 17, 2008.

  1. EngSara

    EngSara

    Joined:
    May 17, 2008
    Messages:
    1
    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, May 17, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. nik_marquise

    HijackThis help . . . not log file . . . Help

    nik_marquise, Jun 8, 2004, in forum: Computer Support
    Replies:
    1
    Views:
    369
    ┬░Mike┬░
    Jun 8, 2004
  2. Jerry G.

    Log On Screen Changed. No More Auto-Log On.

    Jerry G., Oct 22, 2004, in forum: Computer Support
    Replies:
    2
    Views:
    530
    Locke Nash Cole
    Oct 22, 2004
  3. Pundit
    Replies:
    0
    Views:
    1,668
    Pundit
    Feb 28, 2005
  4. Michael Mason
    Replies:
    1
    Views:
    1,944
    Michael Mason
    Aug 16, 2004
  5. bilal0khalid
    Replies:
    2
    Views:
    867
    bilal0khalid
    Mar 24, 2008
Loading...

Share This Page