title: Convert text files to excel files using python
body: <p>I am working on INFORMIX 4GL programs. That programs produce output text files.This is an example of the output:</p>
  
  <pre><code>Lot No|Purchaser name|Billing|Payment|Deposit|Balance|                
  J1006|JAUHARI BIN HAMIDI|5285.05|4923.25|0.00|361.80|                 
  J1007|LEE, CHIA-JUI AKA LEE, ANDREW J. R.|5366.15|5313.70|0.00|52.45| 
  J1008|NAZRIN ANEEZA BINTI NAZARUDDIN|5669.55|5365.30|0.00|304.25|     
  J1009|YAZID LUTFI BIN AHMAD LUTFI|3180.05|3022.30|0.00|157.75|  
  </code></pre>
  
  <p>This text files can manually convert to excel files.But, I wanna ask, is there any script that I can use to convert .txt files to .xls files ?</p>
  
  <p>Hi all,now I'm already can convert text files to excell file by python using script that was given from user named Rami Helmy.A big thanks for him.But now,That script will produce more than one excell files depends on the number of '|' from the text files.Beside that,That script also can only convert one text files.I a going to convert all text files without state the name of text files.Therefore,I am looking such a way on how to this script going to:</p>
  
  <ul>
  <li>output only one excell file</li>
  <li>convert all .txt files from the directory that was given from user. </li>
  <li>output excell's file name are automaticly copied from the file name of text files.</li>
  </ul>
  
  <p>I am new in python,hopefully someone can help me to solve my problems.Thank You..</p>
  
  <p>done all the task,but there was some problem..the column that had green mark is format as textfile,so I can't make any calculation on that column.That column need to convert to number format.other from that,  output excell files contains an "square" symbol like this:</p>
  
  <p><img src="https://i.stack.imgur.com/i6S6j.png" alt="enter image description here"></p>
  
  <p>then, how to make the green mark column format as number when convert file? and how can I ensure that there is no square symbol like that? Please help,thank you...</p>
  
  <p>That strange square symbol are already gone but that green mark are still exist.
  <img src="https://i.stack.imgur.com/xzXDl.png" alt="enter image description here"></p>
  
  <p>Hi all. I had one question to ask, I already got script that was given by RamiHelmi, but the extension file name will produce file such as:</p>
  
  <p>tester.txt --> tester.txt.xls</p>
  
  <p>therefore,how can i remove the '.txt. on the output files so that it will only produce "tester.xls" files extension.Hopefully,someone can help solve my problem..thank you</p>