How to read a file line by line and making a new file for each line having same filename as last word of each line? : <p>Suppose the file contents are:</p>

<pre><code>May 30, Thu,    England vs SouthAfrica,     Match 1 ,Afternoon, London
May 31, Fri,    Windies vs Pakistan,    Match 2 ,Afternoon, Nottingham
Jun 01, Sat,    NewZealand vs SriLanka, Match 3 ,Afternoon, Cardiff
</code></pre>

<p>I want to create three files each having names London, Nottingham and Cardiff. Each file must have its own line. Like,content of Nottingham should be:</p>

<pre><code>May 31, Fri,    Windies vs Pakistan,    Match 2 ,Afternoon
</code></pre>

<p>I don't want to use awk. Any help is appreciated.</p>
