Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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??

Comment on ParseExcel Again
Re: ParseExcel Again
by marto (Chancellor) 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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1018514]
Approved by ww
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-07-28 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (209 votes), past polls