Hi, thanks for the reply, this would be fine if I didn't have to extract the error rows into another location and then concatenate them back in. While that isn't too difficult (grep them out, sort, unique then cat them back in). As far as solutions go I'd rather just keep the script simpler/cleaner and delete all instances.<br>
<br>This is what I want to achieve.<br><br>Input File:<br>====================================================================<br><div id=":25f"><span style="font-family:courier new,monospace">some information: blable</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">This was happening: blah blah</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: something went wrong</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: I'm not happy</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">error: something went wrong</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: something went wrong</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">error: something went wrong</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: something went wrong</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">error: I'm not happy</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: I'm not happy</span><br style="font-family:courier new,monospace">
<br>Summary<br>Stuff that worked: 10,000<br>Errors: 8<br>====================================================================</div><br><br>Output:<br>====================================================================<br>
<div id=":25f"><span style="font-family:courier new,monospace">some information: blable</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">This was happening: blah blah</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: something went wrong</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"><br>
</span>Summary<br>
Stuff that worked: 10,000<br>
Errors: 8<br>
====================================================================</div>
<br>Or<br>====================================================================<br>
<div id=":25f"><span style="font-family:courier new,monospace">some information: blable</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">This was happening: blah blah</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: something went wrong</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">error: I'm not happy</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"></span><br>
Summary<br>
Stuff that worked: 10,000<br>
Errors: 8<br>
====================================================================</div>
<br><br>I'll play with awk a bit. See if that gets me where I want to be.<br><br><br><div class="gmail_quote">On 19 January 2012 12:37, Paul Littlefield <span dir="ltr"><<a href="mailto:info@paully.co.uk">info@paully.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 19/01/12 10:47, David Halliday wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
More Ideal would be to include only one instance of the unique error messages but I believe that will be a little more complicated and more time than it is worth (not to mention that a more complicated solution is harder to explain to people I'm working with).<br>
</blockquote>
<br></div>
cat /tmp/error.txt |grep '^error' |sort |uniq<br>
<br>
Paully<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
Kent mailing list<br>
<a href="mailto:Kent@mailman.lug.org.uk" target="_blank">Kent@mailman.lug.org.uk</a><br>
<a href="https://mailman.lug.org.uk/mailman/listinfo/kent" target="_blank">https://mailman.lug.org.uk/<u></u>mailman/listinfo/kent</a><br>
</div></div></blockquote></div><br>