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]);
In reply to Re^4: convert excel cell into "Text" format with Excel:: Write::xlsx modul
by sarf13
in thread convert excel cell into "Text" format with Excel:: Write::xlsx modul
by sarf13
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |