This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes How do i use windows to find a string pattern in one of my .java files? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "How do i use windows to find a string pattern in one of my .java files?" Watch "How do i use windows to find a string pattern in one of my .java files?" New topic
Author

How do i use windows to find a string pattern in one of my .java files?

Ana Suvari
Ranch Hand

Joined: Aug 18, 2009
Posts: 43
Since I can't use Jcreator or Eclipse, I am wondering how i can get rid of some debug statements i left in my .java files. I know i can use Notepad but how do i search all my files containing debug statements?

Is there a command in DOS windows to search for patterns in a bunch of .java files???

Please help me.
Paul Clapham
Sheriff

Joined: Oct 14, 2005
Posts: 19693
    
  10

Start Windows Explorer and use the Search button. You can't use complex patterns but you can certainly search for the word "debug" in your source code.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 19932
    
  43

The UNIX tool that does this is called ... grep, which windows doesn't seem to have. However, grep seems to be so popular that if you google "grep windows", you get a ton of tools that claim to do what grep does, except on windows. Maybe one of those grep-like tools might work.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Personally, I always install Cygwin on any Windows machine I'm forced to use. It has grep, along with a bunch of other stuff that you may or may not find useful.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 43392
    
  32
What about one of the decent text editors, eg jEdit, Notepad++, Notepad2, which all work on Windows and (I think) will have decent search facilities?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: How do i use windows to find a string pattern in one of my .java files?
 
It's not a secret anymore!