llarochelle has asked for the wisdom of the Perl Monks concerning the following question:
I got it to work, but only if the 3 lines for the loop are in the same cell. Then it gets funky, and I think the problem is with encoding or something like that, where I get totally lost. I get : " blank ip address bla bla blank ip address bla bla blank " I'm totally clueless. In fact I adjusted encoding and binmode while creating the Template->new object and calling the process sub[% FOREACH item IN secondaries %] ip address [% item.ip %] [% item.mask %] secondary [% END %]
and I found out I could add the "text wrap" format to the cell. Which I did. But the result is ... crappy ? And when I try to copy and paste the content of this cell it litterally outputs "ip address bla bla\nip address bla bla\n" (including the ") Can someone help me on this one please ? Cheers, Lucsub template_s_r { my ($lineref, $dataref) = @_; my $val; my $tt = Template->new({ ENCODING => 'utf8' }); $tt->process(\$lineref, $dataref, \$val, {binmode => ':utf8'}) or die + $$tt->error, "\n"; return $val || 0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Template::Toolkit with Excel files
by iguanodon (Priest) on Nov 29, 2018 at 14:18 UTC | |
by llarochelle (Beadle) on Nov 29, 2018 at 15:16 UTC | |
by Aldebaran (Curate) on Dec 01, 2018 at 01:44 UTC | |
by llarochelle (Beadle) on Dec 07, 2018 at 15:40 UTC | |
|
Re: Using Template::Toolkit with Excel files
by 1nickt (Canon) on Nov 29, 2018 at 10:32 UTC | |
by llarochelle (Beadle) on Nov 29, 2018 at 19:53 UTC | |
by llarochelle (Beadle) on Nov 29, 2018 at 15:17 UTC |