title: split a file name
body: <p>How do i write a python script to split a file name</p>
  
  <p>eg</p>
  
  <pre><code>LN0001_07272010_3.dat
  </code></pre>
  
  <p>and to rename the file to <code>LN0001_JY_07272010</code>?</p>
  
  <p>also how do i place a '|' and the end of each line in this file(contents) each line is a record?</p>