ochez has asked for the wisdom of the Perl Monks concerning the following question:
For a task at work, I am trying to write a program that 1.) parses a list of paper titles from an excel spreadsheet, 2.) scrapes google scholar to get/return the "cited by:" numbers for each title, and 3.) puts these numbers in the spreadsheet column next to the titles.
Basically I am trying to combine a simple spreadsheet parser with a nested for loop that I wrote with fetch.pl found at this site: http://davide.eynard.it/cgi-bin/perlcode.pl?file=scholar.pl
It all seems simple enough, but I just can't get them to work together. At this point I'm just trying to have the fetch.pl program return the "cited by:" numbers, but I also found a script that would probably benefit more in my case: Spreadsheet::ParseExcel::SaveParser
If anyone could help me out real quick, I'd be very grateful. I feel like an experienced programmer could do this in five minutes if they wanted.
My Excel Parser looks like this:
#!/usr/bin/perl -w use strict; <br>use Win32::OLE qw(in with); <br>use Win32::OLE::Const 'Microsoft Excel'; <br> <br>$Win32::OLE::Warn = 3; # die on err +ors... <br># get already active Excel application or open new <br> my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); <br># open Excel file <br>my $Book = $Excel->Workbooks->Open("C:/Documents and Settings/rto5 +u/My Documents/CV.xls"); <br># select worksheet number 1 (you can also select a worksheet by na +me) <br>my $Sheet = $Book->Worksheets(1); <br>foreach my $row (2..4) <br>{ <br>foreach my $col (1) <br>{ <br># skip empty cells next unless defined $Sheet->Cells($row,$col)->{'Value'}; <br># print out the contents of a cell <br> print "At ($row, $col) the value is: \n", <br> $Sheet->Cells($row,$col)->{'Value'}; <br> print "\n"; <br>} <br>} <br>print "\n"; <br># clean up after ourselves <br>$Book->Close;
My apologies for the bad formatting, I'm a little rusty with my HTML
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Combining Excel Parser with Google Scholar Scraper
by kennethk (Abbot) on Apr 14, 2009 at 15:22 UTC | |
by ochez (Initiate) on Apr 14, 2009 at 15:36 UTC | |
by kennethk (Abbot) on Apr 14, 2009 at 15:53 UTC | |
by ochez (Initiate) on Apr 14, 2009 at 16:07 UTC | |
by kennethk (Abbot) on Apr 14, 2009 at 16:53 UTC | |
Re: Combining Excel Parser with Google Scholar Scraper
by Nkuvu (Priest) on Apr 14, 2009 at 18:41 UTC |