ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: Inserting text at start of file
Date Wed, 02 Apr 2003 07:06:11 GMT
You can use replaceregexp.

    <replaceregexp flags="s">
      <regexp pattern="^"/>
      <substitution expression="${line.separator}"/>
      <fileset dir=".">
        <include name="test.txt"/>
      </fileset>
    </replaceregexp>

Peter.
On Wednesday 02 April 2003 08:54, North Alex wrote:
> 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
View raw message