Want to merge and delete duplicate rows of ms excel files - php

I have suppose 10 separate .xls files. i want to merge them and also delete the duplicate rows..
can some 1 suggest me any codes for that???? is it possible to do it using php codes???

for xlsx files (Office 2007+) you can do that using the excel library for PHP. See "http://www.codeplex.com/PHPExcel". It will allow you to open read and write xlsx files

The simplest Way is to export the Data as CSV and then Process it.

Related

removing duplicates from different Excel files

I am having many excel files in a folder, I have to create a tool to read those files and remove duplicate data between files using PHP and MYSQL.
So that i tried to read the data using Excel reader and store them in database
I was struggling to remove the duplicate fields
And also exporting the remaining data to excel file
Try this it may help you with your duplications http://www.databasejournal.com/features/mysql/article.php/10897_2201621_2/Deleting-Duplicate-Rows-in-a-MySQL-Database.htm
And if you want to import the data using php Click [Here]http://www.programmingfacts.com/export-mysql-data-into-excelcsv-via-php/

Converting a txt file to excel,then modiying excel and import the new excel file to a database

I would like to convert a txt file to excel and then modify certain data inside the excel file and then import this new excel file to a database using PHP. The contents of the excel file, for example, will be with products and prices of them and the modification will be on the prices.
Is this even possible using PHP or I will need something else?
Seems like a rather roundabout way of doing this, but I've had great success with Excel/php with phpExcel. That will get read/write Excel, but putting it into the database will likely require som php coding.
If you're just editing datas in Excell (no formulas ...) you should try csv format ...
I think that you should send a example of your txt file ...
Mimiz

How can i take an excel file, parse it contents and store the column's data of excel sheet in my database column?

There is one excel sheet which contains student name, rollno etc. How can i parse the contents of excel file and store that in my sql database?
You are looking for PHPExcel library i believe.
http://phpexcel.codeplex.com/
use this class to read the excel files
http://sourceforge.net/projects/phpexcelreader
If you want to do it directly from the Excel file, rather than create an intermediate CSV using Excel's "Save As" options, then look at libraries such as PHPExcel that can read the xls binary format and make the data accessible to your PHP script.
I'd recommend to you that you save it as csv, it's much more easier and less hacking to upload it to the database
here is simple a sample
http://www.bradino.com/php/csv-upload-to-database/
PHPExcel is one of the best PHP classes i have ever worked with. In addition to parsing and reading files of all Excel variations (including csv) the output to Excel 2007 + is excellent.
Be sure to look at the documentation and examples...they will get you up to speed very quickly

Convert .xls file to xml using php

I need to implement a functionality where a user can upload an Excel file, that is, .xls file and i need to write a function that will read that file and then save the values in a table, compare them to values in another table and then print some kind of billing quotation.
From what I have read, it seems that the best way to do that is to first convert that file to an xml file and then write a function to parse that xml file.
I want to know, is it possible to write a function in php that will convert an xls file to xml. Assuming that the users will save and upload the file as xls.
Thanks.
i often let admin users upload a csv file they exported from an xcel file, its much simpler to parse through using http://php.net/manual/en/function.fgetcsv.php
A quick Google search for "PHP excel parser" turns up PHP Excel Reader, for an open source library to use for reading data from .xls files. There may be others that suit your needs.
I have been successfully using the 'ABC Excel Parser Pro' from Zakkis.
This allows converting from a XLS file directly into a MySQL table.
A few notes on limitations:
column count must match exactly to database columns
Excel 2007 format (xlsx) are not supported

Create a multi-tabs Excel file

My PHP script have to create a multi-tabs Excel file with a report in each tab, but those reports already exists as HTML pages, so I don't want to duplicate code and work.
I know I can rename a HTML file to .xls, and Excel/OpenOffice Calc will open it as a spreadsheet, but I don't know how to have severals tabs.
I do not even know if it is possible.
I already know Biffwriter and others PHP libs to create Excel file, but I am looking for a smarter solution.
Thanks,
Cédric
Pear Excel Spreadsheet Writer has a function to create new Worksheets if thats what you are looking for.
If you don't mind serving excel 2007 files, you can do this:
create an excel 2007 file
create all the tabs you need
save the file
rename the file as .zip
extract the contents of the zip file
Now you can use the file structure there to populate the file corresponding to each tab with the report you need. You may want to use them as templates, keep the same code and render different files depending on whether you generate the html report of the excel report.
In the end, zip up the entire directory structure and serve it with an xlsx extension.
Please check the URLS of
a library
and
turorials
from IBM and
from 999Tutorials

Categories