Deleting lines containing specific words in text file in Ruby
<p>I have a text file like this:</p>

<pre><code>User accounts for \\AGGREP-1

-------------------------------------------------------------------------------
Administrator            users                    grzesieklocal
Guest                    scom                     SUPPORT_8855
The command completed successfully.
</code></pre>

<p>First line is empty line. I want to delete every empty lines in this file and every line containing words "User accounts for", "-------", "The command". I want to have only lines containing users. I don't want to delete only first 4 and the last one lines, because it can be more users in some systems and file will contain more lines.
I load file using </p>

<pre><code>a = IO.readlines("test.txt")
</code></pre>

<p>Is any way to delete lines containing specific words? </p>