Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>"Into something useful" means to me that your first step is to create classes, structs, and enums that represent your data:</p> <pre><code>public class RouterEntry { public ConnectionState ConnectionState { get; } public int Retry { get; } ... public long BytesTX { get; } } </code></pre> <p>Then, start thinking about how to parse the result strings. I would probably write a <code>Deserialize(StringReader)</code> method (or something along those lines) so that your object parses the data line by line. </p> <p>You can also use <a href="http://msdn.microsoft.com/en-us/library/ms131448.aspx" rel="nofollow noreferrer"><code>string.Split</code></a> with the SplitOptions overload to help you ignore any blank spaces.</p> <p>So for example, if you use</p> <pre><code>Port: OBC PortNr: 0 PortState: forwarding Interface: up </code></pre> <p>as your input line, and </p> <pre><code>char[] delims = new char[] { ':', ' ' }; </code></pre> <p>as your delimiters, then calling it like this</p> <pre><code>string[] tokens = line.Split(delims, StringSplitOptions.RemoveEmptyEntries); </code></pre> <p>would result in <code>tokens</code> containing</p> <pre><code>[Port, OBC, PortNr, 0, PortState, forwarding, Interface, up] </code></pre> <p>For the lines that have multiple "values" for a key (such as <code>Regeneration table: 0 1 2 3...</code> you'll just to take into account the fact that each of those values will be a separate string in the tokens array).</p> <p><em>The key is that if you break your problem down one bit a time, it should become more manageable to solve.</em></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload