title: Python - Parsing a text onto columns by the position of each item
body: <p>The Bovespa (brazilian stock exchange) offer a file with all the quotes in a timeframe. The file is too large, and each line are something like this real sample:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>012016010402AAPL34      010APPLE       DRN          R$  000000000415000000000042200000000004150000000000421300000000042080000000003950000000000435000005000000000000012500000000000052664400000000000000009999123100000010000000000000BRAAPLBDR004115</code></pre>
  </div>
  </div>
  </p>
  
  <p>So, looking for the docs, I found that the column mapping is something like that:</p>
  
  <ul>
  <li>char 01 to 02: (int) type of register;</li>
  <li>char 03 to 10: (date) date of the stock quote info;</li>
  <li>char 11 to 12: (int) some kind of code;</li>
  <li>char 13 to 24: (str) the stock ticker;</li>
  <li>....</li>
  </ul>
  
  <p>I'm starting to study Python and trying to read a file which contains this data, and got each line sucessfull with this code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>import pandas as pd
  dataset1 = pd.read_table('bmfbovespaquotes/DemoCotacoesHistoricas12022003.txt')</code></pre>
  </div>
  </div>
  </p>
  
  <p>I think that maybe this is a silly question, but I didn't find the solution already, so if you know a way to solve this, please share.</p>
  
  <p>Thanks</p>