Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@jakarta.apache.org Received: (qmail 27064 invoked by uid 500); 22 Oct 2001 13:48:51 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: ant-user@jakarta.apache.org Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 27034 invoked from network); 22 Oct 2001 13:48:50 -0000 Subject: RE: search for words in a file To: ant-user@jakarta.apache.org X-Mailer: Lotus Notes Release 5.0.8 June 18, 2001 Message-ID: From: Christine.Woon@nurun.com Date: Mon, 22 Oct 2001 09:42:04 -0400 X-MIMETrack: Serialize by Router on LeChiffere/Toronto/nurun(Release 5.0.8 |June 18, 2001) at 10/22/2001 09:49:54 AM MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N Where do the source files, i.e Copy.java exist on the apache site? "Mark Ayad" net> cc: Subject: RE: search for words in a file 10/17/2001 05:15 PM Please respond to ant-user Earlier this week I raised something on similar lines. I wanted to use ant to process a file set using my own class. Getting started is easy: I copied the src file Copy.java and renamed it to MyCopy.java (changed the class name / constructor accordingly) Also depending on 'where' you place this file you will need to ammend the package defn at the top of the file. when the task is called the execute() is called...just follow it form there. Next you will need to get the contents of the file and parse it. If it plain text then it is easy .. indexOf... Hope this helps. I looking at buiding a simple search engine task using ant to pass files for Lucene to process. Regards Mark -----Original Message----- From: T Master [mailto:tmaster@iknowledgeinc.com] Sent: Wednesday, October 17, 2001 9:52 PM To: ant-user@jakarta.apache.org Subject: Re: search for words in a file It would seem your best bet is to create your own custom ant task. This would have a method to search a given java file for "void main(String[]" , and if it doesnt have that, then return the filename including full path. In the end, you could return a FileSet object. Nope, never done something like that. Fun to learn though :) ----- Original Message ----- From: To: Sent: Wednesday, October 17, 2001 12:41 PM Subject: Re: search for words in a file > > I would like to search a word within a file. For example I do not want to > include any *.java files in my fileset that have a 'main' method in it. > > > > "T Master" > > geinc.com> cc: > Subject: Re: search for words in a file > 10/17/2001 01:54 > PM > Please respond to > ant-user > > > > > > > Look at FileSet in the user manual. > A FileSet can be based upon a file, that contains a list (line seperated) > of files to include. > Another file cna be used to exclude a list of files. > > If you can, think about your logic use, and modify to suit. > > T Master. > > From: > Sent: Wednesday, October 17, 2001 7:30 AM > Subject: search for words in a file > > > > I am new at Ant, and was curious if there is any task to search for a > > specific word i.e 'main' in a file. > > If the word doesn't exist then include it in a fileset, otherwise ignore > > it. > > > > > >