Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 89213 invoked from network); 22 Feb 2007 17:38:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Feb 2007 17:38:30 -0000 Received: (qmail 53541 invoked by uid 500); 22 Feb 2007 17:38:32 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 53504 invoked by uid 500); 22 Feb 2007 17:38:32 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 53493 invoked by uid 99); 22 Feb 2007 17:38:32 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Feb 2007 09:38:32 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [209.191.69.48] (HELO web30201.mail.mud.yahoo.com) (209.191.69.48) by apache.org (qpsmtpd/0.29) with SMTP; Thu, 22 Feb 2007 09:38:20 -0800 Received: (qmail 4554 invoked by uid 60001); 22 Feb 2007 17:37:59 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=FCOPFy/4Hp1c+zOw877VJfA2h+6w3AZAVEJDw8QLVQoUgyc54gGuRVfuKQGeIGW2fFxiG0dei4ZCN5NEmVEPgWeQ4Sdbr4WGZDh9WUritnhSDuP0PfiMaWEsrkgKUyUzYqc/ZHSQJn/r/sSPEtAUU2ySoTVgw/mwtdhGWe9QL5I=; X-YMail-OSG: M3P53KUVM1mtBJioO2c8lf9ZNt0zJgzDQFIpnfBSSLT.nIN290x6rRFuHntYPuFdLIkfPBeFTfijgMuNhnIwWYAvuqhoG4DGkkmS5M7GiazzAszaPY7Rdc4gTGxmwN.MX6fFiq1yv7YbJ48- Received: from [71.8.201.198] by web30201.mail.mud.yahoo.com via HTTP; Thu, 22 Feb 2007 09:37:59 PST X-Mailer: YahooMailRC/368.8 YahooMailWebService/0.6.132.8 Date: Thu, 22 Feb 2007 09:37:59 -0800 (PST) From: Ninju Bohra Subject: Re: Using ant to parse text file To: Ant Users List MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Message-ID: <251010.3525.qm@web30201.mail.mud.yahoo.com> X-Virus-Checked: Checked by ClamAV on apache.org Then I would look at writing a quick custom task (they really aren't that = hard) so that you can eliminate all the details of the file structure to wi= thin the task.=0A=0AI would see something like:=0A=0A=0A=0AYou would pass in = (as attributes) the filename, the lookfor value (i.e. 'Test2'), and the nam= e of the property that would be defined whose value will the group that was= found.=0A=0AThis is a lot cleaner than exposing/manipulating the file (and= it rigid structure) through a series of generic ANT tasks.=0A=0AJust my $.= 02,=0A=0ANinju=0A=0A=0A----- Original Message ----=0AFrom: "DHARNA, AJAY [A= G/1000]" =0ATo: Ant Users List =0ASent: Thursday, February 22, 2007 9:58:05 AM=0ASubject: RE: Using ant= to parse text file=0A=0A=0AI have looked at the property task as well - bu= t I will not be able to=0Achange the file format.=0A=0AI used the following= target to get "Test2"=0A=0A=0A =0A =0A = =0A =0A =0A =0A =0A ${text}= =0A =0A=0AIs there anyway to get back the line number where this = is found - If I=0Acan get back the line number - I could use the headfilter= to get this=0Anext line.=0A=0AThank you=0A=0AAjay Dharna=0A=0A=0A-----Orig= inal Message-----=0AFrom: Kevin Jackson [mailto:foamdino@gmail.com] =0ASent= : Thursday, February 22, 2007 1:59 AM=0ATo: Ant Users List=0ASubject: Re: U= sing ant to parse text file=0A=0A=0A> [Sample.txt]=0A> Test1=0A> Group=3Dre= d=0A>=0A> Test2=0A> Group=3Dblue=0A>=0A> Test3=0A> Group=3Dgreen=0A>=0A> Ex= ample:- If I was to provide the value "Test2", I would like the Ant =0A> to= search for "Test2" in the file, and return the value "blue". If I =0A> pro= vide the value - "Test3", it should return the value "green"=0A>=0A> Please= let me know if there is any simple way of doing this using Ant.=0A=0AGiven= that you don't seem to have any more data for each of the Tests=0A- why do= n't you just do=0A=0ATest1=3Dred=0A=0Athen you can use Ant's property task= =0A=0AEven if you are going to group things together you can still use=0Apr= operties just separate the properties into separate files and then=0Awhen y= ou provide Test2, Ant can then lookup the appropraitely names=0ATest2.prope= rties and then load the values=0A=0AUnless you want to do something else, I= think you want the properties=0Atask=0A=0AKev=0A=0A-----------------------= ----------------------------------------------=0ATo unsubscribe, e-mail: us= er-unsubscribe@ant.apache.org=0AFor additional commands, e-mail: user-help@= ant.apache.org=0A=0A=0A----------------------------------------------------= -----------------------------------------------------=0AThis e-mail message= may contain privileged and/or confidential information, and is intended to= be received only by persons entitled to receive such information. If you h= ave received this e-mail in error, please notify the sender immediately. Pl= ease delete it and all attachments from any servers, hard drives or any oth= er media. Other use of this e-mail by you is strictly prohibited.=0A=0A=0AA= ll e-mails and attachments sent and received are subject to monitoring, rea= ding and archival by Monsanto. The recipient of this e-mail is solely respo= nsible for checking for the presence of "Viruses" or other "Malware". Monsa= nto accepts no liability for any damage caused by any such code transmitted= by or accompanying this e-mail or any attachment.=0A----------------------= ---------------------------------------------------------------------------= --------=0A=0A=0A----------------------------------------------------------= -----------=0ATo unsubscribe, e-mail: user-unsubscribe@ant.apache.org=0AFor= additional commands, e-mail: user-help@ant.apache.org=0A=0A=0A =0A________= ___________________________________________________________________________= _=0AIt's here! Your new message! =0AGet new email alerts with the free Yah= oo! Toolbar.=0Ahttp://tools.search.yahoo.com/toolbar/features/mail/ --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org