title: split based on the first "-" from the last in a line
body: <p>I have the below script which basically deletes the sentence after "-",it is breaking when announce.txt contains the below input as it has multiple "-" ,i basically want to split based on the first "-" from the last..please
  suggest how to do that...i have hte expected output</p>
  
  <p>INPUT:- //components/rel/bt.wcnss/2.4/wcnss_proc/bt/platform/rom/inc/oi_sbc_tables-generated.h#1 - branch change 700801 (text)</p>
  
  <p>EXPECTED OUTPUT:- //components/rel/bt.wcnss/2.4/wcnss_proc/bt/platform/rom/inc/oi_sbc_tables-generated.h#1</p>
  
  <pre><code>f = open('announce.txt', 'r')
  z = f.readlines()
  f.close()
  
  k = []
  
  for items in z:
      print 'Current item %s'%items
      answer = items.split('-');
      k.append(answer[0].strip() + '\n')
  
  f2 = open('foobar4.txt', 'w')
  f2.writelines(k)
  f2.close()
  </code></pre>