ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject RE: A new twist on "Problem with the replaceregexp task!!!"
Date Thu, 11 Dec 2003 16:55:25 GMT
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!


-----Original Message-----
From: Antoine Lévy-Lambert []
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,

-----Urspr√ľngliche Nachricht-----
Von: Nagarajan Murugesan []
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" />

Nagarajan M

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message