Sandeep Kumar has asked for the wisdom of the Perl Monks concerning the following question:
Hi Everyone, Hope you all are doing well, this is my first question here. Actually I'm trying to merge cells dynamically using merge_range. I need to make every cells merged in column A only when column B has some common string. I'm very new to perl, so not aware of much methods in it. I have tried this, but not sure how to proceed for this.
while (<CSVFILE1>) { if ($csv->parse($_)) { my @Fld = $csv->fields; my $col = 0; my $a = 1; foreach my $token (@Fld) { for my $a (@Fld) { my $a = $a + 10; my $b = $a + 10; } my $range = "A".$a.":A".$b; $worksheet->write($row, $col, $token); $worksheet->merge_range($range, $token, $merge_format); my $temp = $a; my $a = $b; my $b = $temp; $col++; $token++; } $row++; } else { my $err = $csv->error_input; print "Text::CSV_XS parse() failed on argument: ", $err, "\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to merge cells dynamically using some variable as input in excel using perl
by kcott (Archbishop) on Jun 21, 2018 at 10:33 UTC |