This was an interesting request! Although I have a solution for you, I suggest you review it. I may have not documented all steps. I wanted to show one way of solving this.
First we need to clean the data. We can do that by first reading the log file contents and using InputText.Split(Environment.NewLine.TocharArray) this results in an array
Next we iterrate through the array and look for lines where we can see some transaction and where the item is not empty string (newline charcter ) i.e., item.Length > 0 AND item.Contains("Card_Perso") and save it to a List (of String) We save the ouputs to a list
We clear outputs from the new log file (we do this so that every run has a new temporary log file)
This will return a formatted text file : Head #06,GLOBAL TIME= 20025ms,PERSO=18216, SERVER= 1809ms
We now can convert the results from Step 4 (new formatted log file) to excel. But to do that we first have to define a datatable and extract only the values of the cateogries for example Head #06 → Head as Column name and 06 as value
We use the same .split method on newline charcter to extract an array of strings, on which we can use regex. The output from regex will give you values to be added to the Datatable we built in Step 5 using add data row. Finally outside the for each loop we use write range to make an excel file