title: Remove specific character from a csv file, and rewrite to a new file
body: <p>I have a VBA macro pulling stock data every 5 minutes on the entire NYSE. This pulls everything from current price, to earnings dates, to p/e, among other metrics. I'm now trying to set up a cronjob to run a little python code to clean up the csv data before I import it into the mySQL database. Before I can set up the cronjob, I need to get the python code working... Baby steps :).</p>
  
  <p>I went away from python a few years ago, but am trying to use it again here. After some research, it's been vetted that back in 2.6 they removed many of the string methods, followed by the maketrans() argument in 3.1. I'm running python 3.3.</p>
  
  <p>Does anyone have any suggestions for my code below? I'm pulling in 1 line of the csv file at a time, and trying to replace the percent sign (%), with nothing (''). I've tried using the replace() argument within an if statement, but that's not working either. Many, many thanks in advance.</p>
  
  <p>Thanks,</p>
  
  <p>Dan</p>
  
  <pre><code>import csv
  import string
  
  input_file = open('StockData.csv', 'r')
  output_file = open('Output.csv', 'w')
  data = csv.reader(input_file)
  writer = csv.writer(output_file)
  specials = '%'
  
  for line in data:
      trans = s.makestrans(specials, ''*len(specials))
      new_line = line.translate(trans)
      writer.writerow(new_line)
  
  input_file.close()
  output_file.close() 
  </code></pre>