in reply to Re^3: Append new line in excel sheets
in thread Append new line in excel sheets
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...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Append new line in excel sheets
by CountZero (Bishop) on Jul 14, 2014 at 06:21 UTC | |
by perl_new_b (Novice) on Jul 14, 2014 at 06:59 UTC | |
by roboticus (Chancellor) on Jul 23, 2014 at 11:49 UTC | |
by perl_new_b (Novice) on Jul 23, 2014 at 12:49 UTC | |
by roboticus (Chancellor) on Jul 23, 2014 at 17:09 UTC | |
| |
by perl_new_b (Novice) on Jul 23, 2014 at 13:14 UTC | |
by CountZero (Bishop) on Jul 15, 2014 at 16:52 UTC | |
by perl_new_b (Novice) on Jul 21, 2014 at 11:41 UTC | |
by perl_new_b (Novice) on Jul 21, 2014 at 13:19 UTC | |
|