ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antoine Lévy-Lambert <anto...@antbuild.com>
Subject Re: A new twist on "Problem with the replaceregexp task!!!"
Date Thu, 11 Dec 2003 21:41:42 GMT
Hi Jay,

download the jakarta-oro jar (see installing ant, library dependencies).
then you have to run ant with the command line option 
-D"ant.regex.regeximpl=org.apache.tools.ant.util.regexp.JakartaOroRegexp"
jakarta-oro-2.0.7.jar 	regexp type with mappers and the perforce tasks 
http://jakarta.apache.org/oro/


Cheers,

Antoine


res09fo9@verizon.net wrote:

>I'm attempting to reverse this process and replace a character with a new line.
>
><replaceregexp file="./testfile.txt" match=";" replace="\r\n" flags="g" />
>
>Does not give me the desired result. Instead, I get the literal characters, "r" 
>and "n" as replacements for the ";". 
>
>Is there a replacement pattern to do this, with replaceregexp? Or is there 
>another way to accomplish this within an ANT script?
>
>Thanks in advance!
>
>-Jay
>
>-----Original Message-----
>From: Antoine Lévy-Lambert [mailto:antoine@antbuild.com]
>Sent: Thursday, December 11, 2003 8:58 AM
>To: Ant Users List
>Subject: AW: Problem with the replaceregexp task!!!
>
>
>
>Hi Nagarajan,
><replaceregexp file="C:/runant.txt" match="\r\n" replace="," flags="g" />
>
>Will be better,
>Cheers,
>Antoine
>
>-----Ursprüngliche Nachricht-----
>Von: Nagarajan Murugesan [mailto:NMURUGESAN@Selectica.com]
>Gesendet: Donnerstag, 11. Dezember 2003 14:23
>An: 'Ant Users List'
>Betreff: Problem with the replaceregexp task!!!
>
>
>
>Hi All,
>
>I have the problem with using <replaceregexp> task.
>
>I have written a task to replace a new line character
>in a text file. once it get exceuted, i opened in a
>notepad(by default), it contains small rectangle kind
>of character before the replacement string.
>
>How could i remove this junk character from the file.
>please help me on this.
>
>Here is my code:
>
><replaceregexp file="C:/runant.txt" match="\n" replace="," flags="g" />
>
>Thanks,
>Nagarajan M
>
>
>
>---------------------------------------------------------------------
>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


Mime
View raw message