Hello,

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;

The spreadsheet just has titles of papers in the first column...I'd like to eventually have the program write in "cited by" results in the column next to it.

My apologies for the bad formatting, I'm a little rusty with my HTML


In reply to Combining Excel Parser with Google Scholar Scraper by ochez

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.