Separate lines in a text file : <p>I have a .txt file. Containing INSERT Scripts. </p>

<pre><code>INSERT INTO TABLE (COL1, COL2, COL3) VALUES (1, 2, 3)
INSERT INTO TABLE (COL1, COL2, COL3) VALUES (1, 2, 3)
INSERT INTO TABLE (COL1, COL2, COL3) VALUES (1, 2, 3)
INSERT INTO TABLE (COL1, COL2, COL3) VALUES (1, 2, 3)
INSERT INTO TABLE (COL1, COL2, COL3) VALUES (1, 2, 3) INSERT INTO TABLE (COL1, COL2, COL3) VALUES (1, 2, 3)

and so on... 
</code></pre>

<p>I want to read this file and output each INSERT statement separately. 
There could be a possibility that a INSERT script is not separated by a new line. it could be continued in the same line. As it can be seen for the last INSERT script. </p>

<p>So I wanted to know if I can read this text file and separate each line whenever I find a new 'INSERT' word ? </p>
