Page 1 of 1
Grouping data
Posted: Tue Jun 15, 2004 1:25 am
by S_henry
Let say I have the records of students (name, address, phone no, course etc..) in a cd. This record let say in MS Excel format. I want to extract all the records into my system and automatically put all the records into their group. In my system, I have 4 group :Town A, B, C and D. I want the system put all the students record into their group base on their location (which town) automatically from the data on the cd. Anybody get the idea how to make this?
Posted: Tue Jun 15, 2004 3:08 am
by fastfingertips
First you should load that excel file in a proper structure (parse it) the you will be able to insert this info were you need. Unfortunatelly almost this scripts are paid ones but you may try on sourceforge.
Other method is to convert the Excel to XML and from XML will become just a child play.
Posted: Tue Jun 15, 2004 3:09 am
by Grim...
Start by using excel to save as a comma delimited file. Then use PHP to read through the file, copying each student out into one of four new files depending on their location.
Useful functions will be [php_man]fread[/php_man]() and [php_man]fwrite[/php_man]().
Posted: Tue Jun 15, 2004 3:13 am
by fastfingertips
Also a fast way is to save your excel file into a csv format then use the "fgetcsv" function.
All this because Excel files are binary and cannot be read by PHP.
The only way to do this would be to have Excel installed on a windows server which is running PHP and then convert the file using COM functions. This solution will only work on a server running Windows.
Hm also there is another possibility: ODBC

Posted: Tue Jun 15, 2004 4:46 am
by S_henry
Thanx for the responses. I will try to find out first and come back here again if get any problem. Thanx..
Posted: Tue Jun 15, 2004 5:39 am
by JayBird
You can read Excel files, but the script ain't free
http://www.zakkis.ca/products/index.php?s=6&p=37
Do you need a script that can read MS Excel files and save the data in
database, HTML pages and etc.? Do you want to do it with PHP under Unix and
Linux but without using Windows tools like COM? Then PHP - Excel file parser
is the right tool for you. All you will need is just our excelparser.php and
PHP enabled web server without any further tools.
The Professional version of PHP Excel Parser, has the debug function,
support multiple Excel font and formula processing! It also reads Excel
Dates prior 01.01.1970!
What's new in 4.0 version:
Support MAC Excel files
Mark