Skip to content

Instantly share code, notes, and snippets.

@s4553711
Created June 17, 2013 09:03
Show Gist options
  • Save s4553711/5795612 to your computer and use it in GitHub Desktop.
Save s4553711/5795612 to your computer and use it in GitHub Desktop.
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";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment