ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Julius Davies <juliusdav...@cucbc.com>
Subject Re: Cleaning a text file with tons of extra CRLF's
Date Thu, 13 Jan 2005 03:49:28 GMT
Hi, Nat,

I never would have thought of that!  Really neat!

Actually, "&#013;" is a CR, not 015.

yours,

Julius

On Wed, 2005-01-12 at 21:25 -0500, Nat Gross wrote:
> Thanks, but for whatever reason, I can't get  replacetoken to work, 
> regardless if using CDATA or plain strings.
> BUT, you pointed me in the right direction and the following *partially* 
> works:
>  <replace file="${basedir}/build370.xml"  token="&#010;&#010;" 
> value="&#010;" summary="true">
> 
> However, it's only a partial solution, because it takes care of only 
> about half the white space, and heaven knows what the other white space 
> really is. Alas there is no valid &#015; escape sequence. (That would 
> represent a CR).
> 
> Also to Martin, alas, I'm not well versed in regex.
> -nat
> 
> 
> Julius Davies wrote:
> 
> >Try this:
> >
> ><replace file="test.txt" value="">
> >  <replacetoken><![CDATA[
> >
> >]]></replacetoken>
> >  <replacevalue><![CDATA[
> >]]></replacevalue>
> ></replace>
> >
> >Be careful to make sure the CDATA only contains the EOL's and no extra
> >whitespace!
> >
> >BEFORE:
> >=======================
> >this file
> >
> >seems to be
> >
> >double spaced
> >
> >except for the
> >very last line.
> >
> >
> >AFTER:
> >=======================
> >this file
> >seems to be
> >double spaced
> >except for the
> >very last line.
> >
> >
> >yours,
> >
> >Julius
> >
> >On Wed, 2005-12-01 at 19:34 -0500, Nat Gross wrote:
> >  
> >
> >>Hi;
> >>On Windows, I get a daily text file from another process that has tons 
> >>of extra EOL's, which I manually delete with my editor.
> >>How can I use Ant's filter to copy the file and strip all duplicate 
> >>eol's? The fixeol task does not cut it. It should have an option to 
> >>remove the eol, or replace every 2 consecutive eol's with 1.
> >>If its a quick one for you, please advise.
> >>Thank you.
> >>-nat
> >>
> >>---------------------------------------------------------------------
> >>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


Mime
View raw message