You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Pankaj Arora01 <Pa...@infosys.com> on 2009/04/06 12:17:10 UTC

Getting substring in ANT

HI All,



I have following directory structure:



C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

C:\abc\deploy\oracle\NAAM09102NNAQBX\NAAM09102NNAQBX_ext_point_address01

C:\abc\deploy\oracle\ NAAM09102NNAQCF\NAAM09102NNAQCF_ext_sdo01



I have a variable x that contains following value:

C:\abc\deploy\oracle



Now I need to iterate through above directory and for each of the above directories, I need two values in the same loop:



1) C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

2) NAAM09102NNAQAE_core01



I am able to retrieve the 1) but not the second one. I need something like substring...



Please help...





















**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

RE: Getting substring in ANT

Posted by Pankaj Arora01 <Pa...@infosys.com>.
Thank you all. Its done

-----Original Message-----
From: Pankaj Arora01 [mailto:Pankaj_Arora01@infosys.com] 
Sent: Monday, April 06, 2009 6:13 PM
To: Juergen.Knuplesch@icongmbh.de; Ant Users List
Subject: RE: Getting substring in ANT

Hi Jürgen ,

Can you please help me in finding the regular expression that needs to be used?

In a loop, @{file} contains "C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01".

What regular expression shall I use so that I get NAAM09102NNAQAE_core01?

Thanks
Pankaj 

-----Original Message-----
From: Knuplesch, Juergen [mailto:Juergen.Knuplesch@icongmbh.de] 
Sent: Monday, April 06, 2009 4:03 PM
To: Ant Users List
Subject: AW: Getting substring in ANT

As I wrote last week in a different context:

I use propertyregex from antcontrib:

          <propertyregex property="vm.propertyname" input="${vm.propertytupel}" 
            regexp="([^#]*)#([^#]*)" 
            select="\1"
            defaultvalue="Error"
            override="true"/>
          <echo>Property vm.propertyname=${vm.propertyname}</echo> 


--
Jürgen Knuplesch 


-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: Pankaj Arora01 [mailto:Pankaj_Arora01@infosys.com] 
Gesendet: Montag, 6. April 2009 12:17
An: Ant Users List
Betreff: Getting substring in ANT

HI All,



I have following directory structure:



C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

C:\abc\deploy\oracle\NAAM09102NNAQBX\NAAM09102NNAQBX_ext_point_address01

C:\abc\deploy\oracle\ NAAM09102NNAQCF\NAAM09102NNAQCF_ext_sdo01



I have a variable x that contains following value:

C:\abc\deploy\oracle



Now I need to iterate through above directory and for each of the above directories, I need two values in the same loop:



1) C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

2) NAAM09102NNAQAE_core01



I am able to retrieve the 1) but not the second one. I need something like substring...



Please help...





















**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


RE: Getting substring in ANT

Posted by Pankaj Arora01 <Pa...@infosys.com>.
Hi Jürgen ,

Can you please help me in finding the regular expression that needs to be used?

In a loop, @{file} contains "C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01".

What regular expression shall I use so that I get NAAM09102NNAQAE_core01?

Thanks
Pankaj 

-----Original Message-----
From: Knuplesch, Juergen [mailto:Juergen.Knuplesch@icongmbh.de] 
Sent: Monday, April 06, 2009 4:03 PM
To: Ant Users List
Subject: AW: Getting substring in ANT

As I wrote last week in a different context:

I use propertyregex from antcontrib:

          <propertyregex property="vm.propertyname" input="${vm.propertytupel}" 
            regexp="([^#]*)#([^#]*)" 
            select="\1"
            defaultvalue="Error"
            override="true"/>
          <echo>Property vm.propertyname=${vm.propertyname}</echo> 


--
Jürgen Knuplesch 


-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: Pankaj Arora01 [mailto:Pankaj_Arora01@infosys.com] 
Gesendet: Montag, 6. April 2009 12:17
An: Ant Users List
Betreff: Getting substring in ANT

HI All,



I have following directory structure:



C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

C:\abc\deploy\oracle\NAAM09102NNAQBX\NAAM09102NNAQBX_ext_point_address01

C:\abc\deploy\oracle\ NAAM09102NNAQCF\NAAM09102NNAQCF_ext_sdo01



I have a variable x that contains following value:

C:\abc\deploy\oracle



Now I need to iterate through above directory and for each of the above directories, I need two values in the same loop:



1) C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

2) NAAM09102NNAQAE_core01



I am able to retrieve the 1) but not the second one. I need something like substring...



Please help...





















**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: Getting substring in ANT

Posted by "Knuplesch, Juergen" <Ju...@icongmbh.de>.
As I wrote last week in a different context:

I use propertyregex from antcontrib:

          <propertyregex property="vm.propertyname" input="${vm.propertytupel}" 
            regexp="([^#]*)#([^#]*)" 
            select="\1"
            defaultvalue="Error"
            override="true"/>
          <echo>Property vm.propertyname=${vm.propertyname}</echo> 


--
Jürgen Knuplesch 


-- 
Jürgen Knuplesch                    www.icongmbh.de
icon Systemhaus GmbH                Tel. +49 711 806098-275
Sophienstraße 40                    
D-70178 Stuttgart                   Fax. +49 711 806098-299

Geschäftsführer: Uwe Seltmann
HRB Stuttgart 17655
USt-IdNr.: DE 811944121 
-----Ursprüngliche Nachricht-----
Von: Pankaj Arora01 [mailto:Pankaj_Arora01@infosys.com] 
Gesendet: Montag, 6. April 2009 12:17
An: Ant Users List
Betreff: Getting substring in ANT

HI All,



I have following directory structure:



C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

C:\abc\deploy\oracle\NAAM09102NNAQBX\NAAM09102NNAQBX_ext_point_address01

C:\abc\deploy\oracle\ NAAM09102NNAQCF\NAAM09102NNAQCF_ext_sdo01



I have a variable x that contains following value:

C:\abc\deploy\oracle



Now I need to iterate through above directory and for each of the above directories, I need two values in the same loop:



1) C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01

2) NAAM09102NNAQAE_core01



I am able to retrieve the 1) but not the second one. I need something like substring...



Please help...





















**************** CAUTION - Disclaimer ***************** This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


AW: Getting substring in ANT

Posted by Ja...@rzf.fin-nrw.de.
Maybe <basedir> ?

Jan 

>-----Ursprüngliche Nachricht-----
>Von: Pankaj Arora01 [mailto:Pankaj_Arora01@infosys.com] 
>Gesendet: Montag, 6. April 2009 12:17
>An: Ant Users List
>Betreff: Getting substring in ANT
>
>HI All,
>
>
>
>I have following directory structure:
>
>
>
>C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01
>
>C:\abc\deploy\oracle\NAAM09102NNAQBX\NAAM09102NNAQBX_ext_point_
>address01
>
>C:\abc\deploy\oracle\ NAAM09102NNAQCF\NAAM09102NNAQCF_ext_sdo01
>
>
>
>I have a variable x that contains following value:
>
>C:\abc\deploy\oracle
>
>
>
>Now I need to iterate through above directory and for each of 
>the above directories, I need two values in the same loop:
>
>
>
>1) C:\abc\deploy\oracle\NAAM09102NNAQAE\NAAM09102NNAQAE_core01
>
>2) NAAM09102NNAQAE_core01
>
>
>
>I am able to retrieve the 1) but not the second one. I need 
>something like substring...
>
>
>
>Please help...
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>**************** CAUTION - Disclaimer *****************
>This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION 
>intended solely 
>for the use of the addressee(s). If you are not the intended 
>recipient, please 
>notify the sender by e-mail and delete the original message. 
>Further, you are not 
>to copy, disclose, or distribute this e-mail or its contents 
>to any other person and 
>any such actions are unlawful. This e-mail may contain 
>viruses. Infosys has taken 
>every reasonable precaution to minimize this risk, but is not 
>liable for any damage 
>you may sustain as a result of any virus in this e-mail. You 
>should carry out your 
>own virus checks before opening the e-mail or attachment. 
>Infosys reserves the 
>right to monitor and review the content of all messages sent 
>to or from this e-mail 
>address. Messages sent to or from this e-mail address may be 
>stored on the 
>Infosys e-mail system.
>***INFOSYS******** End of Disclaimer ********INFOSYS***
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org