Read several values from 3 CrystalMark dump files

I benchmark systems using CrystalMark three times, saving the data to text files. After this I import the data to an Excel file with the intention of finding the average value of the three benchmarks, before copying the average scores to the master benchmark Excel file. The trouble is, opening the text files in Excel is rather messy and a lot of formatting has to be done long before calculating the averages.

I had an idea to use Visual Studio 2012 to make a Win32 application that loads the three files' most important data only (ALU,FPU,MEM,HDD,GDI,D2D and OGL) and calculates their averages and copies them to the clipboard ready to be pasted into the master benchmark Excel file (for comparison with other tested systems).

Here is the first 23 lines of a CrystalMark benchmark dump, for easy reference:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CrystalMark 2004R3 [0.9.126.452] (C) 2001-2008 hiyohiyo
                                  Crystal Dew World [http://crystalmark.info/]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
CrystalMark Result
------------------------------------------------------------------------------
   Display Mode : 1680 x 1050 32bit (ClearType)

    CrystalMark :  151118

[ ALU ]             25983
      Fibonacci :   10395
      Napierian :    4981
   Eratosthenes :    3637
      QuickSort :    6948
[ FPU ]             26041
        MikoFPU :    2852
     RandMeanSS :   13674
            FFT :    4974
     Mandelbrot :    4519
[ MEM ]             15239


Currently I have created the form; there are four columns of textboxes (three for the three benchmarks and one for the average). Above each column is a button to import the benchmark data. Pressing 'Import File 1' button will bring up the OpenFileDialog window. When I open a benchmark file it loads the entire benchmark data into the first ALU textbox which is obviously not what I want (all that is visible is '-=-=-=-=-=-' from the start of the file). I need to find the line (always line 13 for ALU) and take only the benchmark value (eg '25983', not '[ALU] 25883') from that line. Then I need to repeat the process for the other benchmarked components (FPU, MEM, etc). Finally the column should show only the values for each of the components tested.

Another hurdle for me is that currently only the ALU textbox is being updated, and not the FPU, MEM, HDD, etc textboxes. This is probably very obvious to experienced coders.

From 'form1.vb'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Public Class Form1

    Private Sub Button_File1_Click(sender As Object, e As EventArgs) Handles Button_File1.Click

        OpenFileDialog1.ShowDialog()
        Dim textfilename1 As String = OpenFileDialog1.FileName
        If System.IO.File.Exists(textfilename1) Then
            Dim read As New System.IO.StreamReader(textfilename1)
            ALU1.Text = read.ReadToEnd
            FPU1.Text = read.ReadToEnd
            MEM1.Text = read.ReadToEnd
            HDD1.Text = read.ReadToEnd
            GDI1.Text = read.ReadToEnd
            D2D1.Text = read.ReadToEnd
            OGL1.Text = read.ReadToEnd
            read.Close()
        End If

    End Sub
End Class


Should something like 'getline' and then delete the 17 characters before the value I want be inserted after this:
If System.IO.File.Exists(textfilename1) Then

By now you're correctly guessing I'm pretty new to C++!
Topic archived. No new replies allowed.