Amit Saxena <[EMAIL PROTECTED]> wrote: > On Mon, Jul 21, 2008 at 11:22 AM, Sivasakthi > <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > How to convert data available from excel sheet to hash table?
> If the data is not very complicated, convert the excel into > .csv file and then read that file line by line to convert into a hash. Dear Amit, The way you keep repeating your CSV mantra leads me to believe that you're getting paid to do it. Either that, or it's a very strange case of "if all you've got is a hammer, everything looks like a nail". *shrugs* As for the OP, why don't you go ahead and actually do some work for yourself by reading the Spreadsheet::ParseExcel manpage. This code sample from the module's synopsis basically does all that you need in terms of reading the XLS file: use strict; use Spreadsheet::ParseExcel; my $excel = Spreadsheet::ParseExcel::Workbook->Parse($file); foreach my $sheet (@{$excel->{Worksheet}}) { printf("Sheet: %s\n", $sheet->{Name}); $sheet->{MaxRow} ||= $sheet->{MinRow}; foreach my $row ($sheet->{MinRow} .. $sheet->{MaxRow}) { $sheet->{MaxCol} ||= $sheet->{MinCol}; foreach my $col ($sheet->{MinCol} .. $sheet->{MaxCol}) { my $cell = $sheet->{Cells}[$row][$col]; if ($cell) { printf("( %s , %s ) => %s\n", $row, $col, $cell->{Val}); } } } } Now all you gotta do is store the data in your favourite data structure instead of printing it. HTH, Thomas -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/