ram31 has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I want to write the content of excel data in to text file. I didn't get the desired text data. I get only references! Part of my code is given below:
for my $worksheet ( $workbook->worksheets() ) { my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); open (FILE,">>","output.txt"); for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $cell = $worksheet->get_cell( $row, $col ); next unless $cell; print FILE "$cell->value()"; } }
Incorrect output: Spreadsheet::ParseExcel::Cell=HASH(0xa02fa74)->value()Spreadsheet::Par +seExcel::Cell=HASH(0xa249680)->value Expected output: text1 text2 etc

I could print the data to standard terminal or redirect the output to file. I want to create output.txt file to process the data inside perl script further .

Replies are listed 'Best First'.
Re: Write content of excel data in to text file
by toolic (Bishop) on Dec 05, 2013 at 20:35 UTC
      Hi, Thanks, it worked. I have not cleaned the old content as i am appending the file and couldnt see the data too :)