Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

How to use a formula in perl

by padawan_linuxero (Scribe)
on Jan 22, 2008 at 17:39 UTC ( #663640=perlquestion: print w/replies, xml ) Need Help??

padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:

Hello all
I have a question, I am working on getting data from 2 different excel files, I use vlookup to get the data, in excel it works great but now I need to automatize these part and I found my self stuck with something, how to do a formula of excel in perl??? I have no clue the only module I am using right now is WIN32::OLE, even the vlookup is not that hard, but I have been looking for information but without any luck.

Thanks

Replies are listed 'Best First'.
Re: How to use a formula in perl
by olus (Curate) on Jan 22, 2008 at 17:54 UTC
Re: How to use a formula in perl
by moklevat (Priest) on Jan 22, 2008 at 18:59 UTC
    Although I'm not entirely sure what you are trying to accomplish, as olus mentioned, you might want to use Spreadsheet::ParseExcel to read the files. However, you should look into Spreadsheet::WriteExcel if you want to generate an Excel formula and write out the Excel binary file format. However, please note that this module does not store results with the formula (in other words, it behaves as if autocalculate is off).
      Hi sorry if it is a bot confusing, I have a script made in perl that generates a bunch of XLS files, but now I need to add some data on them but these data is store in another xls file call customs.xls, so I in excel create a formula using vlookup to get the data (just a customer number and the name of the customer) so I need to put the formula in the script and I just dont know how to do that add to a cell the formula and make the formula work. this is the formula that I need to put in my script but I have no Idea on how to do it
      =VLOOKUP(A9,PATENTES.xls!$A$2:$C$82,2,FALSO)
        Ah, I think I understand better now. You are getting the data from Excel files and you want to replicate the effect of =VLOOKUP(A9,PATENTES.xls!$A$2:$C$82,2,FALSO) on the data in a perl script.

        Rather than trying to sort out how VLOOKUP works on your worksheets, it would be much easier to help if you can post the perl code you are using to read the data, a small example of the data, and a description of the result you want. It seems like you may be able to read data into a hash using "customer number" as a key and the name as the value, but I'm just guessing at this point.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2020-11-26 10:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?