0

I'm new to PHP and don't know how to convert .xls file to .csv. I want to update my mysql database automatically, so I downloaded the data in a file named update.xls. I want to convert that file to update.csv so that I can use LOAD FILE in mysql through PHP. Can anyone help

Harish Pareek
  • 120
  • 1
  • 2
  • 9
  • You better read this: http://stackoverflow.com/questions/7766317/how-to-convert-excel-xls-to-csv-using-php – Vijaya Pandey May 08 '13 at 09:43
  • So have you looked at any Excel reader libraries like PHPExcel ( http://phpexcel.codeplex.com ) ? Or any of these - http://stackoverflow.com/questions/3930975/alternative-for-php-excel – Mark Baker May 08 '13 at 09:45
  • I'm reading the PHPExcel documentation. It's installation needs php_gd2.dll, php_zip.dll and php_xml.dll. I don't have php_xml.dll but instead having php_xmlrpc.dll. Will turning on that extension can work for PHPExcel? – Harish Pareek May 08 '13 at 10:20
  • Hi Harish, No, php_xml and php_xmlrpc are totally different things (xmlrpc is an communication thing like soap). – Veda Oct 02 '13 at 11:44

1 Answers1

0

You can open update.xls using Microsoft Execl (maybe openoffice can also do this) and then save again as csv file. You can load the file in, for example, phpmyadmin.

Natively php cannot read xls files. You need a library for that.

Veda
  • 2,025
  • 1
  • 18
  • 34