Thread: Counting Files

  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 1999
    Rep Power
    I am trying to count the number of files that have a particular string in their file names in a specified directory. Something like:

    $number = count("*$string*.*");

    Any ideas? Thanks
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 1999
    Rep Power
    this is one way ..
    I think ..

    $string = "sfd";

    $d = dir("$path");
    while($entry=$d->read()) {
    print "$i dirs or files in $path contained $string";

    [This message has been edited by kvack (edited January 11, 2000).]

Similar Threads

  1. Can't move or delete it!
    By Hykinsel007 in forum Windows Help
    Replies: 3
    Last Post: June 15th, 2004, 03:41 PM
  2. Reading files that has certain parrent at once
    By cgi_pro in forum Perl Programming
    Replies: 2
    Last Post: January 29th, 2004, 10:13 PM
  3. how to rename files
    By dxgn in forum Perl Programming
    Replies: 1
    Last Post: January 1st, 2004, 01:10 PM
  4. Please help with counting the sizes of files
    By danield in forum Perl Programming
    Replies: 8
    Last Post: December 24th, 2003, 10:20 AM
  5. How can I pack servlet files into a jar file?
    By suryahema in forum Java Help
    Replies: 1
    Last Post: December 18th, 2003, 08:32 AM

IMN logo majestic logo threadwatch logo seochat tools logo