I use a simulator (ndnSIM) in Linux which is based on the C++. After doing some tasks, it prints an output in each second in the stdout
by this command:
L3RateTracer::InstallAll ("-", Seconds (1));
. This is constant and I cannot change its format to print the output in a string or an array. I want to extract a specific data from this output from stdout
. For instance, the output in the 1st second has been printed in stdout
as follows (the space between each feature is by Tab):
1 C1 0 1 Out1 268 335 0
1 C1 0 2 Out2 0 0 0
1 C2 1 1 Out1 0 0 0
1 R3 1 1 Out2 317 0 0
1 P1 -1 all Sat1 268 0 335
1 C1 -1 all Tim1 0 0 0
1 R2 1 9 Out1 0 0 0
I need to extract 6th column data for those outputs which are "R3" in 2nd column and "Out2" in 5th column. In this example, the desired value is "317".
How can I extract this value (=317) in each second from the printed output in the stdout
by C++?