Python capture file parsing
<p>I have a radius capture file, and I need to parse it.  How can I grab individual value pairs and aggregate them.  Here is a quick snippet of the file:</p>

<pre><code>Acct-Session-Id = "1234adb"
Acct-Session-Time = 141312
Acct-Input-Octets = 1234123
</code></pre>

<p>This repeats on and on, continually with same structure but different values.</p>

<p>I need to aggregate the Octets, which is easy since I just do <code>"if "Acct-Input-Octets" in</code> structure.</p>

<p>The problem comes in the total will change IF Session-Time goes to 0 (i.e. they re-connect).  Therefore the running total needs to reset, unless it doesn't in which case it is an error (in RADIUS Input-Octets must reset with new Session-ID).</p>
