I have this perl script:
use Spreadsheet::WriteExcel::Big;
use XML::SAX::ExpatXS;
#use lib qw(/vweb/cl2000/docs/);
use lib qw(/opt/perl/scripts);
use ExcelSAX;
$excel_file_path = "/proddata/coll/targift/ftp/";
$book_cnt = 1;
$sheet_cnt = 1;
# The location of the XML file to be parsed.
$file = "/proddata/coll/targift/ftp/TARGIFT_CARDSALES_RPT_031711_0933.
+xls";
#$file = "OPERATOR_LEAD_RPT062405_51457.xml";
$day = (localtime(time))[3];
$month = ((localtime(time))[4]) + 1;
$year = ((localtime(time))[5]) + 1900;
$basename = "MONTHLY_INVENTORY_$year"."_$month"."_$day";
$callback = sub {
my $worksheet = shift;
my $workbook = shift;
my $format1 = $workbook->add_format();
$format1->set_num_format('$#,##0.00');
$worksheet->set_landscape(); # Landscape mode
$worksheet->set_column(0, 0, 10);
$worksheet->set_column(1, 1, 35);
$worksheet->set_column(2, 2, 15);;
$worksheet->fit_to_pages(1,0); # set to 1 page wide and as long as nee
+ded
$worksheet->set_footer('&CPage &P of &N');
};
$handler = ExcelSAX->new("$excel_file_path", 0, $callback);
$parser = XML::SAX::ExpatXS->new( Handler => $handler );
$parser->parse_uri($file);
This is the error that I am receiving.
perl /vweb/cl2000/docs/targift/xml/targift_card_sales_rpt_MARKL.pl
Created workbook /proddata/coll/targift/ftp/TARGIFT_CARDSALES_RPT_0317
+11_1235.xls
unclosed token at line 2191, column 3, byte 32765 at /vweb/cl2000/docs
+/targift/xml/targift_card_sales_rpt_MARKL.pl line 55
The data is as follows. There are three columns trying to be created.
<ROW>
<COL1 >T1500</COL1>
<COL2 >1</COL2>
<COL3 >50</COL3>
</ROW>
<ROW>
<COL1 >T1502</COL1>
<COL2 >1</COL2>
<COL3 >50</COL3>
</ROW>
<ROW>
<COL1 >T1505</COL1> <--- Line in the error.
<COL2 >1</COL2>
<COL3 >50</COL3>
</ROW>
<ROW>
<COL1 >T1506</COL1>
<COL2 >1</COL2>
<COL3 >50</COL3>
</ROW>
<ROW>
Not a perl programmer so I am lost at why this is not working.
Thanks