ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Inserting text at start of file
Date Wed, 02 Apr 2003 08:00:25 GMT
Not tested:


<echo file="tmp" message="new text"/>
<move file="theFile" tofile="tmp2"/>
<concat destfile="theFile">
    <filelist files="tmp,tmp2"/>
</concat>
<delete>
    <fileset dir="." includes="tmp tmp2"/>
</delete>


Jan Matèrne

> -----Urspr√ľngliche Nachricht-----
> Von: North Alex [mailto:Alex.North@tapiola.fi]
> Gesendet am: Mittwoch, 2. April 2003 09:54
> An: user@ant.apache.org
> Betreff: Inserting text at start of file
> 
> Hi
> 
> I want to insert a line of text (with CR LF at end) to the start of an
> existing file.  There is no token to replace ... just a plain 
> insert at
> start.
> 
> I just can't seem to find any simple way of doing it.  I have come up
> with a complicated-well-over-the-top way of copying files and 
> using the
> concat task.  While it's something that works, it's a ugly 
> and I have a
> feeling of reinventing the wheel in rock.  Upgrading ANT and/or
> installing optional tasks is an option (currently using ANT 1.5.1).
> 
> Could someone point me in the right direction, please?
> 
> <= Alex =>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message