At 15:21 -0600 6/29/02, Chase wrote:
>Does anyone know of a way that I can export an Excel spreadsheet to 
>a file that I can import to MySQL?  I found a program that will do 
>this for Access, but I would rather leave Access out of this if 
>possible. Thanks!!
>
>Chase

Does it have to be written in PHP? :-)

#! /usr/bin/perl -w
# from_excel.pl - read Excel spreadsheet, write tab-delimited,
# linefeed-terminated output to the standard output.

use strict;
use Spreadsheet::ParseExcel::Simple;

@ARGV or die "Usage: $0 excel-file\n";

my $xls = Spreadsheet::ParseExcel::Simple->read ($ARGV[0]);
foreach my $sheet ($xls->sheets ())
{
         while ($sheet->has_data ())
         { 
                 my @data = $sheet->next_row ();
                 print join ("\t", @data) . "\n";
         }
}

exit (0);

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to