Excel spreadsheet to delimited text

use Spreadsheet::ParseExcel;
my $file = shift || die "Give me an Excel file!\n";
-e $file and -r _ or
    die "Must provide valid Excel file! $file, $!\n";
my $excel_obj = Spreadsheet::ParseExcel->new();
my $workbook = $excel_obj->Parse($file);
die "Workbook did not return worksheets!\n"
    unless ref $workbook->{Worksheet} eq 'ARRAY';
for my $worksheet ( @{$workbook->{Worksheet}} ) {
    for my $row ( 0 .. $worksheet->{MaxRow} ) {
        for my $col ( 0 .. $worksheet->{MaxCol} ) {
            my $cell = $worksheet->{Cells}[$row][$col];
            print ref $cell ? $cell->Value : '';
            print "\t" unless $col == $worksheet->{MaxCol};
        }
        print "\n"; # record ends
    }
    print "\n";     # worksheet ends
}
digg stumbleupon del.icio.us reddit Fark Technorati Faves
Your information (required) Name*
Email*
Website

* Indicates required fields; email is used for validation and is not displayed on the site.

Your comment
Commenting on Excel spreadsheet to delimited text
Title

Body is limited to ≈1,000 words. Paragraphs—but not line breaks—are automatically inserted. Valid XHTML is required. These are the allowed tags–

<a href=""></a> <br/> <acronym title=""></acronym> <abbr title=""></abbr> <code></code> <pre></pre> <tt></tt> <ins></ins> <del></del> <hr/> <cite></cite> <b></b> <i></i> <sup></sup> <sub></sub> <strong></strong> <em></em> <h1></h1> <h2></h2> <h3></h3> <q></q> <blockquote></blockquote>