unix - Can excel execute a cmd command then put the output on a cell? -


What I'm trying to do here is that I have a log file of execution time on the program. Generally, if I have a quick finding that the functions of a program are executed, then the average / maximum performance is to use a combination of grep, gawk, wc, sort and uniq.

i.e. Maximum execution time:

  grep "execution time" console.log | Singer "{Print" $ 8 "," $ 11 "} | Grep" "[FUNC NAME]" | Singer "{Print" $ 1 "}" | "Max == 0 || $ 1 & gt; Max {max = $ 1} END {print max} "I have to know what to do to remove max / average performance of all functions and time and event found in logfile and data is an excel I should be in the format like this:  

(I'm doing it manually to get these values ​​at the command prompt)

How can I do this in VBA? Some googling and test and error Afterwards, after the management of what I want to do in Excel VBA

< P> How do I solve it?

I create 3 custom functions called Custom Max, Customize, CustomContact

Here is a sample code for Custom Max: (Note that I have the path name of the hardcoded file, but you can set it yourself)

Custom Max:

  Function Custom Max (string like var1) S = CreateObject ("wscript.Shell") as a () string Exec ("cmd.exe / c" and "grep" "Execution Time" "": C / User / MDuh / AppData / Local / Red 5 Studio / Firefall / console "Print" "$ 1" "", "$ 1" "" "" "" "" "" "}" "" "| Gok "" max == 0 || $ 1 & gt; Maximum {max = $ 1} END {print max} ""). StdOut.ReadLine CustomMax = s End Function  

What this is doing is creating shell objects, executing command line with command:

  Grep "execution time" console.log | Singer "{Print" $ 8 "," $ 11 "} | Grep -w" [NAME] "| Singer" {Print "$ 1"} "| Gawk" max == 0 || $ 1 & gt; Maximum {max = $ 1} END {print max} " 

Then capture the output with the standout. Readline.

  • One CMD will open in each function call
  • Every time you do something that will update the worksheet, it will reproduce again so that you can reload Manually set

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

javascript - amcharts makechart not working -

java - Algorithm negotiation fail SSH in Jenkins -