I struggled with something similar yesterday, ie. trying to get CR/LF into
the replace pattern. Using XML entities to represent the \r\n did the trick
for me. Try: replace="
"
Manuel
----- Original Message -----
From: <res09fo9@verizon.net>
To: <user@ant.apache.org>
Sent: Friday, December 12, 2003 12:55 AM
Subject: RE: A new twist on "Problem with the replaceregexp task!!!"
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
|