Try this:
sapply(c("csv$", "pdf$"), function(x)length(dir(path=Dir, pattern = x)))
On Mon, Aug 18, 2008 at 4:59 AM, Kurapati, Ravichandra (Ravichandra)
<[EMAIL PROTECTED]> wrote:
>> Let's say,
>
>>
>
>> Dir<-"/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_0
>
>> 1_
>
>> 08_18_08"
> Let's say,
>
> Dir<-"/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_0
> 1_
> 08_18_08"
>
> There will be pdf and/or csv files.
> I want to know how many *.pdf and/or csv files are there in that
directory.
>
> How can I get using R commands.
>
Thanks
K.Ravicha
On Mon, 18 Aug 2008, Kurapati, Ravichandra (Ravichandra) wrote:
> Let's say,
>
> Dir<-"/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_01_
> 08_18_08"
>
> There will be pdf and/or csv files.
> I want to know how many *.pdf files are there in that directory.
>
> How can I get using R
length(Sys.glob(file.path(Dir, "*.pdf)))
or use the 'pattern' argument of list.files()
or use system(paste("ls", file.path(Dir, "*.pdf), "| wc -l"), intern=TRUE)
On Mon, 18 Aug 2008, Kurapati, Ravichandra (Ravichandra) wrote:
Hi
Lets say,
Dir<-"/var/www/html/celnet/users/cxadmin/FlowDur
2008/8/18 Kurapati, Ravichandra (Ravichandra)
<[EMAIL PROTECTED]>:
> Dir<-"/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_01_
> 08_18_08"
>
> There will be pdf and/or csv files.
>
>I want to know how many *.pdf files are there in that
> directory.
> How can
Hi
Lets say,
Dir<-"/var/www/html/celnet/users/cxadmin/FlowDuration_DataVolume/fld_01_
08_18_08"
There will be pdf and/or csv files.
I want to know how many *.pdf files are there in that
directory.
How can I get using R commands.
T
6 matches
Mail list logo