how to search for a number of files in a directory using perl.
8 1305
Hi Ram...
This is the basic example
use Cwd;
$path=getcwd();
opendir(DIR,$path) || die ("Path is invalid\n");
@files=grep(/\./,readdir(DIR));
$i=0;
foreach $fil (@files)
{
print "$fil\n";
$i++;
}
print "Total number of files $i";
hope this will help you..
nAvAs.M
if i am supposed to search for some number of files and have to display,, what can i do..???
if i am supposed to search for some number of files and have to display,, what can i do..???
Did you happen to see the example provided nicely, above, by "savanm"?
Have you tried that example, or any other for that matter? If you are working on some code to do what you are asking and are having problems, then please post your code so we can help you with it. We aren't going to write it for you, but we will help you with your issues if we can.
Regards,
Jeff
if i am supposed to search for some number of files and have to display,, what can i do..???
read the previous posts, look up the functions mentioned, (opendir, grep, readdir, freach, etc, etc, etc) try and understand them, write some code, test the code, then ask some questions about the code you wrote and where you are having problems. Simply repeating your question over is not going to inspire anyone to want to help you. You need to show some effort.
If you had even looked at the book I posted a link for you, you would have come across chapter 6 page 213 which probably will help you.
read the previous posts, look up the functions mentioned, (opendir, grep, readdir, freach, etc, etc, etc) try and understand them, write some code, test the code, then ask some questions about the code you wrote and where you are having problems. Simply repeating your question over is not going to inspire anyone to want to help you. You need to show some effort.
If you had even looked at the book I posted a link for you, you would have come across chapter 6 page 213 which probably will help you.
Oh, you mean you meant for that book to be looked at?!!?!!? Oh MAN!!! What the heck? LOL!
Jeff
Oh, you mean you meant for that book to be looked at?!!?!!? Oh MAN!!! What the heck? LOL!
Jeff
hehehe... a "novel" idea, huh? ;)
hehehe... a "novel" idea, huh? ;)
DOH!!! LOL!
Jeff
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Auction software |
last post by:
Free download full version , all products
http://netauction8.url4life.com/
Groupawy
---------------
Google Groups Email spider. The first email spider for google groups.
Millions of valid...
|
by: Auction software |
last post by:
Free download full version , all products from Mewsoft dot com
http://netauction8.url4life.com/
Groupawy
---------------
Google Groups Email spider. The first email spider for google groups....
|
by: ALI-R |
last post by:
I am using the follwoing code to get all files which have txt as an
extension but I get an error that your search pattern is not correct.it
seems this fuction dosn't accept "*.txt" as search...
|
by: Petyr David |
last post by:
Current:
web page has hard coded directories (using checkboxes) user may choose
to search for files matching a pattern they enter in text box. Perl is
used to search for files and to format HTML...
|
by: Computer geek |
last post by:
Hello, I am new to VB.NET and programming in general. I have taught
myself a lot of the basics with vb.net but am still quite the novice.
I am working on a little application now and I need some...
|
by: ravindarjobs |
last post by:
hi......
i am using ms access 2003,vb6
i have a form.
in that i have 2 buttons
1. start search
2 stop search
when i click the "start search" button the fucntion SearchSystem() is called,...
|
by: Sutharsan Nagasun |
last post by:
Hi, I am new to Perl. I need help with file search for the following scenario.
Currently as part of the archiving process, we have archived the files under
/$rootdir/Archive/yyyy directory where...
|
by: Debadatta Mishra |
last post by:
Introduction
In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
|
by: briggs |
last post by:
Hi All,
I need to take the count of txt and bak files present in all the directory.for eg if we assume there are two directoies say(test1, test2), I need to collect the count(of txt and bak files)...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: ryjfgjl |
last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |