in reply to Re^3: convert excel cell into "Text" format with Excel:: Write::xlsx modul
in thread convert excel cell into "Text" format with Excel:: Write::xlsx modul
please find my test code
#!/usr/bin/perl use strict; use warnings; use Benchmark; my $t0 = Benchmark->new; #use Spreadsheet::WriteExcel; use Excel::Writer::XLSX; my $filePath = 'D:\work\test.txt'; open(FILE,"$filePath"); my $workbook = Excel::Writer::XLSX->new('tab.xls'); my $worksheet = $workbook->add_worksheet(); my $row = 0; while (my $line = <FILE>){ chomp($line); # Split on single tab #print "$line\n"; my @Fld = split('\|', $line); my $cnt = scalar(@Fld); my $col = 0; while ($cnt>= $col){ $worksheet->write_string($row, $col, $Fld[$col]); $col++; } $row++; } my $t1 = Benchmark->new; my $td = timediff($t1, $t0); print "the code took:",timestr($td),"\n";
it giving me this error --- Use of uninitialized value $str in hash element while i am using $worksheet->write_string($row, $col, $Fld[$col]);
its working fine with write subroutine $worksheet->write($row, $col, $Fld[$col]);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: convert excel cell into "Text" format with Excel:: Write::xlsx modul
by roboticus (Chancellor) on Oct 19, 2012 at 20:18 UTC | |
by sarf13 (Beadle) on Oct 22, 2012 at 09:01 UTC |