title: CSV file input and sorted output is formmated incorrectly
body: <p>So I am just trying to learn python and I am working on a program to take in information from a csv file sort it then output it into a new csv file. my problem is that in the output, the data ends up being in one row instead of the original 5 rows. I am not sure why, I am attempting to open the new sorted file in LibreOffice Calc and the formatting is off, does this have something to do with the delimiters? Thanks</p>
  
  <pre><code>import csv
  import operator
  
  name = raw_input()
  
  myfile = name
  o = open(myfile, 'rU')
  mydata = csv.reader(o)
  
  
  sortedlist = sorted(mydata, key=operator.itemgetter(1), reverse=True)
  
  for row in sortedlist:
  print(row[0], row[1], row[2], row[3], row[4])
  
  o.close()
  
  print('Enter the name for the output file')
  ofile = raw_input()
  
  with open(ofile, 'wb') as csvfile:
  sortwriter = csv.writer(csvfile)
  sortwriter.writerow(sortedlist)
  </code></pre>