title: Changing the format of cells in python 2.7 using xlsxwriter or xlwt
body: <p>I am still relatively new to python and having difficulty with a little project. I am converting a csv file to xls file which I have accomplished, and now I am wanting to perform some calculations on some parts of the new xls file. All values are stored as Text, I am trying to convert the cells with numbers into numbers. </p>
  
  <p>From my reading you cannot change cell type without erasing the data stored in the cell using xlsxwriter, is there a way to format the cells prior to writing the data? I have not found any way to convert cell type using xlwt. </p>
  
  <p>I do not think conditional formatting will work in this case as I have not seen a way for it to detect a number and change the format of the cell. </p>
  
  <p>My simple program just copies the csv file and creates a xls file, if there is a way to format the cells as they are being written that is great, if not I know the exact cells the data will be going into so I can format them prior to being written. </p>
  
  <pre><code>import csv, xlsxwriter
  def makeXls(path, fileName):
      wb = xlsxwriter.Workbook(fileName+'.xls')
      ws = wb.add_worksheet('Report')
      with open(path, "rb") as f:
          reader = csv.reader((line.replace('\0','') for line in f), delimiter=';')
          for r, row in enumerate(reader):
              for c, val in enumerate(row):
                  ws.write(r,c,val)
  </code></pre>