[R] number of Excel worksheets

Gabor Grothendieck ggrothendieck at gmail.com
Tue May 8 14:51:05 CEST 2012


On Mon, May 7, 2012 at 8:54 PM, Santosh <santosh2005 at gmail.com> wrote:
> Hello experts!!
> I apologize for posting SPlus related query here..badly in need of relevant
> info..
>
> I usually use R (and your advice/tips) for my daily work. Was wondering if
> there is an equivalent of "sheetCount" of the package "gdata" avaailable in
> Splus 8.2? I would like to get the total number of "tabs" (aka pages) in an
> MS Excel workbook.

Ensure that perl is on your path, put sheetCount.pl and
module-tools.pl from the gdata .tar.gz source file
(http://cran.r-project.org/package=gdata) in the current directory and
then try the counterpart to this R command (which no longer requires
gdata):

as.numeric(system("perl sheetCount.pl myfile.xls", intern = TRUE))


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list