Hi guys, thanks for the response, I figured out to calculate the no of rows using SaveParser but using this I'm unable to save the modified row. Im posting my code , kindly provide any feedback or any thing that I'm missing
sub to_test { my ($self, $in_file) = @_; $count = @_; #To Test util->logit("[$PARENT_PROC_NAME]: in_file[$in_file]"); my $parser_temp = Spreadsheet::ParseExcel::SaveParser->new( CellHandler => \&cell_handler_1, NotSetCell => 0 ); util->logit("[$PARENT_PROC_NAME]: parser_temp[$parser_temp]"); my $sheet_ct = 0; my $Book = $parser_temp->Parse($in_file); util->logit("[$PARENT_PROC_NAME]: parser_temp[$parser_temp], glob_ +sheet_index[$glob_sheet_index],pre_row[$pre_row]"); @count_of_sheet_rows[$glob_sheet_index] = $pre_row; util->logit("[$PARENT_PROC_NAME]: count_of_sheet_rows_3[@count_of_ +sheet_rows], glob_sheet_index[$glob_sheet_index],pre_row[$pre_row]"); #my $workbook = Spreadsheet::WriteExcel->new(); #my $sheet_work = $parser_temp->worksheet(0); #$sheet_work->AddCell( 1, 0, 'Hi Excel!' ); my $temp = "temp"; my $new_path = "$out_file$underscore$temp$extension"; my $Saved_Workbook = $Book->SaveAs($new_path); foreach my $worksheet ($Book->worksheets()) { my $value_row = @count_of_sheet_rows[$sheet_ct]+2; my $value_cell = 0; util->logit("[$PARENT_PROC_NAME]: count value_row[$value_row], wor +ksheet[$worksheet]"); #$worksheet->AddCell(@count_of_sheet_rows[$sheet_ct] + 1, 0, local +time); $worksheet->AddCell($value_row, $value_cell, "World2"); ##$worksheet->AddCell( 1, 0, 'Hi Excel!' ); #$worksheet->write(@count_of_sheet_rows[$sheet_ct], 0, 'Hi Exce +l!'); $sheet_ct++; } #$Book->close(); #$Book->Close(); #$parser_temp->Quit(); #$Saved_Workbook->SaveAs($new_path); $Saved_Workbook->close(); #undef $Book; #undef $parser_temp; return $new_path; }
Kindly suggest something...
In reply to Re^4: Append new line in excel sheets
by perl_new_b
in thread Append new line in excel sheets
by perl_new_b
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |