hi... how to search files in a dir based on specific pattern

M

mahesh

Hi,


how can we search files in adirectory based on specific pattern.
i hav searched the regex api but i did not find any method in
Matcher class or pattern class
which will return a string array by searching the whole directory for
specific pattern
So plz u know any solution for this the tell me
Thanks in advance.

regards
mahesh
 
J

Julian Treadwell

mahesh said:
Hi,


how can we search files in adirectory based on specific pattern.
i hav searched the regex api but i did not find any method in
Matcher class or pattern class
which will return a string array by searching the whole directory for
specific pattern
So plz u know any solution for this the tell me
Thanks in advance.

regards
mahesh



I have written a Java utility program to do this, Java 1.4 with a small
Swing interface. It was written for my own use so you might find it
somewhat quirky but I'd be happy to email it to you if you want to use
it or mod it.
 
K

Knute Johnson

mahesh said:
Hi,


how can we search files in adirectory based on specific pattern.
i hav searched the regex api but i did not find any method in
Matcher class or pattern class
which will return a string array by searching the whole directory for
specific pattern
So plz u know any solution for this the tell me
Thanks in advance.

regards
mahesh

Did you look at the code I replied to your previous post?
 
J

Julian Treadwell

Knute said:
Did you look at the code I replied to your previous post?
I wish I'd looked at it before I wrote my utility program - I did it the
hard way, capturing the output from a "dir" command and checking each
file line by line.

That's what I like about Java, there's always a better way to do things,
you can always improve yourself :)
 
K

Knute Johnson

Julian said:
I wish I'd looked at it before I wrote my utility program - I did it the
hard way, capturing the output from a "dir" command and checking each
file line by line.

That's what I like about Java, there's always a better way to do things,
you can always improve yourself :)

I've been writing java code since 1.0 and I learn new stuff every day.
I really like to prowl the news groups and see other folks solutions to
problems.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top