title: Formatting data from Text (.prn) file
body: <p>I am trying to figure the best way to handle the following data. I am scraping a site and using a Text (.prn)  file (a file for printing, this is the file with the data on I want, I think this would be better than the Adobe Acrobat file) to collect data from. My problem is when I bring the data into python: the data is just coming in vertical down the screen one letter at a time, so even though there are multiple rows this data is just streaming in on one column. I wonder if someone would know how to make the data come in, in  a more "traditional" way where I can bring in row[0], row [1] etc....
  Here is my code in case it helps (you can also see some of the other functions I tried).</p>
  
  <pre><code>import os
  import urllib
  import urllib2
  import string
  import sys
  import os
  from bs4 import BeautifulSoup
  import csv
  import mechanize
  from numpy import*
  import datetime
  import traceback
  from pylab import*
  site="http://www.treasurydirect.gov/govt/reports/pd/mspd/mspd.htm"
  
  br = mechanize.Browser()
  br.set_handle_equiv(False)
  br.open(site)
  print 'br.title',br.title()
  allforms = list(br.forms())
  br.form = allforms[0]
  br.follow_link(text_regex="February", nr=0)
  #br.click_link(text='February', nr=0) # this works to
  
  #next page
  print br.title()
  allforms = list(br.forms())
  print allforms
  br.form = allforms[0]   
  getstuff=br.click_link(text="Text (.prn)", nr=0) # this works to
  #getstuff= br.click_link(text="Adobe Acrobat (.pdf)", nr=0)  Adobe Acrobat (.pdf)
  
  br.open(getstuff)
  
  
  csvData=br.response().read() # use read to BeautifulSoup(x)
  #site = BeautifulSoup(csvData)
  #print site
  for row in csvData:
   print row[0]
  </code></pre>
  
  <p>Here is the exact site page where the text (.prt) file is at:
  <a href="http://www.treasurydirect.gov/govt/reports/pd/mspd/2013/2013_feb.htm" rel="nofollow">http://www.treasurydirect.gov/govt/reports/pd/mspd/2013/2013_feb.htm</a></p>
  
  <p>I am trying to handle the data in the Text (.prn)  file  under SUMMARY.
  please give advice on best way to handle the data.</p>
  
  <p>I am using python27, mechanize, beautiful soup and urllib</p>