raja567 has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I writing a perl script which extracts data from a text file into excel file. I'm using "Spreadsheet::WriteExcel" This is the logic I'm using:
open(INPUT,$outFile) or die "Can't open file"; my $rowCount = 0; while(<INPUT>) { my @elements = split('\|',$_); foreach my $el(@elements) { $worksheet->set_column(0,$colCount,40); $worksheet->write(0,$colCount,$el,$gFmtBold) ; $colCount++; } $colCount = 0; $rowCount++; } $workbook->close();
The problem is, the logic is failing with files containing huge data. eg : I have an input file with 37000 lines, each line consists of 48 fields seperated by "|" delimiter can anyone help me with the issue Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Text file to Excel with perl
by Corion (Patriarch) on Feb 28, 2014 at 15:25 UTC | |
by raja567 (Novice) on Feb 28, 2014 at 15:56 UTC | |
by kcott (Archbishop) on Mar 01, 2014 at 00:19 UTC | |
by vinoth.ree (Monsignor) on Feb 28, 2014 at 16:09 UTC | |
|
Re: Text file to Excel with perl
by fishmonger (Chaplain) on Feb 28, 2014 at 16:25 UTC | |
|
Re: Text file to Excel with perl
by Tux (Canon) on Feb 28, 2014 at 16:47 UTC | |
by fishmonger (Chaplain) on Feb 28, 2014 at 18:11 UTC | |
by Tux (Canon) on Feb 28, 2014 at 18:52 UTC | |
|
Re: Text file to Excel with perl
by PerlSufi (Friar) on Feb 28, 2014 at 20:48 UTC |