ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@antbuild.com>
Subject Re: (newbie) how insert content of one file into middle of another one
Date Thu, 17 Jul 2003 23:02:31 GMT
Hi Monika,
I would recommend that you download ant1.6alpha.
In this version, there are some <headfilter> and <tailfilter> which can be
used inside <filterchain> which itself can be nested into <copy/> or <move/>
Here an example in the doc of ant 1.6

<loadfile srcfile="${src.file}" property="${src.file.head}">
  <filterchain>
    <headfilter lines="15"/>
  </filterchain>
</loadfile>
This stores the first 15 lines, skipping the first 2 lines, of the supplied
data in the porperty ${src.file.head}. (Means: lines 3-17)

You might need to do your work in several step, but it should be possible,
especially if you always need the 2 first lines of file a, then file b, then
the last line of file a.

Antoine


----- Original Message -----
From: "Monika Adamczyk" <monika7@yahoo.com>
To: <user@ant.apache.org>
Sent: Friday, July 18, 2003 12:50 AM
Subject: (newbie) how insert content of one file into middle of another one


> Hi,
>
> I have a file that gets generated by one of the ant tasks (and I have
> no control over this task, so I can't modify it). Once the first file
> gets generated, I need to read content of another file and insert it
> into the first one at specific location (definitively not at the end of
> beginning so I can't concatenate them).
> e.g:
> file 1 has 3 lines
>
> line1
> line2
> line3
>
> file 2 has 2 lines
> lineA
> lineB
>
> As a final result I want to have in file 1
>
> line1
> line2
> lineA
> lineB
> line3
>
> Can someone provide me with an example how to do it?
>
> Monika
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
> ---------------------------------------------------------------------
> 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