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"; } }

In reply to How to merge cells dynamically using some variable as input in excel using perl by Sandeep Kumar

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.