Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

ParseExcel Again

by Anonymous Monk
on Feb 13, 2013 at 10:22 UTC ( #1018514=perlquestion: print w/replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I know there has already been a lot of discussion on Spreadsheet::ParseExcel working. But I still need a bit information . I am using it to parse .xls files and have used reduce memory usage instructions but still memory usage is high.

Anyways just want the unfomatted cell value of these excel sheet nothing else. How can I increase the speed of code ?? I want to discard subroutines or functions which are not useful in my case. So how to go about it??

Replies are listed 'Best First'.
Re: ParseExcel Again
by marto (Archbishop) on Feb 13, 2013 at 10:24 UTC

    "How can I increase the speed of code ??"

    What code? You haven't shown any or linked to existing posts on this topic.

      Its normal code to parse .xls

      $excelRowCounter=0; my $parser = Spreadsheet::ParseExcel->new( CellHandler => \&excelCellhandle +r, NotSetCell => 1, Parameters => "XXXXXXXXX" ); $parser->parse($currentFile); sub excelCellhandler { # my $workbook = $_[0]; # my $sheet_index = $_[1]; my $row = $_[2]; # my $col = $_[3]; my $cell = $_[4]; my $q; if($excelRowCounter == $row) { $q = $cell->unformatted(); $text .= $v; } else { if(length($text) > 2097152) { do something return } $excelRowCounter = $row; $q = $cell->unformatted(); $text .= $v; } }

        If you are not happy with a CPAN module you will have to essentially re-write it ( or at least parts of it )

        You can get the code from CPAN or GitHub, find the chunks that you are using ( which might be a pain considering the number of sub-modules it has ) and then try to optimize it.

        Also that module does not look like it has been maintained in over two years, but you could try to get in touch with the maintainers.

        If you do manage to speed it up / improve it, you might want to submit a patch.

        Or you could just try and get the same data in CSV - is that possible?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1018514]
Approved by ww
[marto]: Corion, I'll talk to you later, but that are is generally fine :)
[hippo]: Just not sure that the expense and hassle is worth the benefit.
[LanX]: expense? .... meeting ppl is inspiring ...
[LanX]: ... and it might be your last chance ... I heard Perl is dead! OO

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (11)
As of 2018-06-20 09:39 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (116 votes). Check out past polls.