s4553711
6/17/2013 - 9:03 AM

A simple example of ExcelHelper module

A simple example of ExcelHelper module

# Include of ExcelHelper Module
use Tool::DB::ExcelHelper;

# definition of mapping between xls title and column
my $xls_schema = {
	'Date' => 'date',
 	'Catalog No' => 'catno',
 	'Type' => 'type',
    'old data' => 'old_val',
 	'new data' => 'new_val',
 	'note' => 'note'
};

my $tool = Tool::DB::ExcelHelper->new();
$tool->Read($job_set->{input},$xls_schema);

while($tool->get_next()){
    # you can get the column value like this
    print $tool->note."\t".$tool->catno."\t".$tool->new_val."\n";
}