Matrix conversion : <p>How do I convert the following column matrix:</p>

<pre><code>129
83
83
83
83
83
47
47
45
45
45
45
112
129
83
83
83
83
39
39
47
46
45
112
112
112
.
.
.
</code></pre>

<p>into this (using awk):</p>

<pre><code>129
83
47
45
129
83
39
47
46
45
112
.
.
.
</code></pre>

<p>Basically, if I have any consecutive instances of a string, I would like to remove any copies. However, for a single instance of '112', I would like to remove it altogether, unless there are at least 2 or more consecutive instances of '112', then I would like to keep a copy of it. Thanks!</p>
