Convert large xlsx file to csv without using phpExcel

csv, excel, php

Solution

You can use python:

wb = xlrd.open_workbook(os.path.join(filepath, 'result.xls'))
sheet = wb.sheet_by_index(0)
fp = open(os.path.join(filepath, 'result.csv'), 'wb')
wr = csv.writer(fp, quoting=csv.QUOTE_ALL)
for rownum in xrange(sheet.nrows):
  wr.writerow([unicode(val).encode('utf8') for val in sheet.row_values(rownum)])

Problem

I have a large xlsx file that is `90MB` using `phpexcel` it is giving me ``` Warning: simplexml_load_string(): Memory allocation failed : growing buffer ``` I tried to load the file using every methods documented here, and also changed php.ini `memory_limit = -1` . I am trying to convert the xlsx file to a csv file so it can be easily loaded. Is there any way to convert xlsx file to csv without using phpexcel?

Original source

Related problems