Created
June 17, 2013 09:03
-
-
Save s4553711/5795612 to your computer and use it in GitHub Desktop.
A simple example of ExcelHelper module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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