wagleg has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use vars qw( $MAX_EMPTY_ROWS ); use Win32::OLE qw/CP_UTF8/; ### Settings ### # The number of max empty rows $MAX_EMPTY_ROWS = 5; # Set UTF-8 support on Win32::OLE->Option(CP => CP_UTF8); # Read the xls and the output filenames from the command line die ( usage() ) if $#ARGV != 1; my $xlsfile = shift (@ARGV); my $xmlfile = shift (@ARGV); # Create OLE object - Excel Application Pointer my $xl_app = CreateObject Win32::OLE 'Excel.Application' or die "Cannot create OLE object: ". Win32::OLE->LastError(); # Open Excel File my $workbook = $xl_app->Workbooks->Open($xlsfile) or die "Cannot open workbook '$xlsfile' (".Win32::OLE->LastError()." +)"; do processing..... # Open the output file open(OUTPUT, ">:utf8", $xmlfile) or die "Cannot open file '$xmlfile' for writing";
janitored by ybiC: <code> and <readmore> tags around code block as per Monastery convention
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Excel -to-XML conversion utility
by dragonchild (Archbishop) on Sep 12, 2003 at 20:48 UTC | |
by wagleg (Initiate) on Sep 12, 2003 at 21:43 UTC |