You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by jonese <gi...@gmail.com> on 2008/02/13 16:43:25 UTC

Copy content of file only?

Hey all i need to take the content of file A and place it into File B.
anyone know the best way to accomplish this?

jonese

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Copy content of file only?

Posted by David Weintraub <qa...@gmail.com>.
Take a look at the <concat> task. Never used it, but it sounds like
exactly what you want:

<concat destfile="${file.b}"
    append="yes"
    fixlastline="yes">
    <filelist dir="${file.a.dir}" files="${file.a}"/>
</concat>



On Feb 13, 2008 10:43 AM, jonese <gi...@gmail.com> wrote:
> Hey all i need to take the content of file A and place it into File B.
> anyone know the best way to accomplish this?
>
> jonese
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 
--
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Copy content of file only?

Posted by jonese <gi...@gmail.com>.
Got it. i was on the right track with concat. just needed to add the
loadfile to get my data, put that into a propery and then use the
value of that property to build my new file!

whew talk about going around your arse to get to your elbow!

<loadfile srcFile="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql"
property="sql.text" />
<concat encoding="UTF-8" destfile="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}_temp.sql"><![CDATA[${sql.text}]]></concat>

Thanks all!

jonese

On Feb 13, 2008 11:36 AM, jonese <gi...@gmail.com> wrote:
> Here's what i have now inside a target:
> <touch file="DB/MS SQL
> ${db.server.version}/boomsocket_MSSQL_${db.server.version}_temp.sql"/>
> <concat destfile="DB/MS SQL
> ${db.server.version}/boomsocket_MSSQL_${db.server.version}_temp.sql">
>         <fileset file="DB/MS SQL
> ${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql" />
> </concat>
> <delete file="DB/MS SQL
> ${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql" />
> <move file="DB/MS SQL
> ${db.server.version}/boomsocket_MSSQL_${db.server.version}_temp.sql"
> tofile="DB/MS SQL
> ${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql" />
> <replaceregexp file="DB/MS SQL
> ${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql"
>         match="\[[a-zA-Z0-1]{1,}\]"
>         replace="[${db.name}]"
>         flags="i" />
>
> The problem is that the concat not only concat's the data but also the
> "headers" of the file thereby corrupting my new file as well.
>
> So essentially what i need is some way to read the contents of a file
> and then take those contents and input them into another file.
>
> i'm on Windows XP if i need to toss this off to some command line stuff.
>
> jonese
>
>
> On Feb 13, 2008 10:53 AM, Scot P. Floess <fl...@mindspring.com> wrote:
> > Are you simply trying to copy file A to file B?  Or take the contents of
> > A and append to B?
> >
> >
> > jonese wrote:
> > > Hey all i need to take the content of file A and place it into File B.
> > > anyone know the best way to accomplish this?
> > >
> > > jonese
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > >
> > >
> > >
> >
> > --
> > Scot P. Floess
> > 27 Lake Royale
> > Louisburg, NC  27549
> >
> > 252-478-8087 (Home)
> > 919-754-4592 (Work)
> >
> > Chief Architect JPlate   http://sourceforge.net/projects/jplate
> > Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
> >
> > Architect Keros          http://sourceforge.net/projects/keros
> >
> >
> > ---------------------------------------------------------------------
> > 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


Re: Copy content of file only?

Posted by jonese <gi...@gmail.com>.
Here's what i have now inside a target:
<touch file="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}_temp.sql"/>
<concat destfile="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}_temp.sql">
	<fileset file="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql" />
</concat>
<delete file="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql" />
<move file="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}_temp.sql"
tofile="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql" />
<replaceregexp file="DB/MS SQL
${db.server.version}/boomsocket_MSSQL_${db.server.version}.sql"
	match="\[[a-zA-Z0-1]{1,}\]"
	replace="[${db.name}]"
	flags="i" />

The problem is that the concat not only concat's the data but also the
"headers" of the file thereby corrupting my new file as well.

So essentially what i need is some way to read the contents of a file
and then take those contents and input them into another file.

i'm on Windows XP if i need to toss this off to some command line stuff.

jonese

On Feb 13, 2008 10:53 AM, Scot P. Floess <fl...@mindspring.com> wrote:
> Are you simply trying to copy file A to file B?  Or take the contents of
> A and append to B?
>
>
> jonese wrote:
> > Hey all i need to take the content of file A and place it into File B.
> > anyone know the best way to accomplish this?
> >
> > jonese
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
> >
>
> --
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC  27549
>
> 252-478-8087 (Home)
> 919-754-4592 (Work)
>
> Chief Architect JPlate   http://sourceforge.net/projects/jplate
> Chief Architect JavaPIM  http://sourceforge.net/projects/javapim
>
> Architect Keros          http://sourceforge.net/projects/keros
>
>
> ---------------------------------------------------------------------
> 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


Re: Copy content of file only?

Posted by "Scot P. Floess" <fl...@mindspring.com>.
Are you simply trying to copy file A to file B?  Or take the contents of 
A and append to B?

jonese wrote:
> Hey all i need to take the content of file A and place it into File B.
> anyone know the best way to accomplish this?
>
> jonese
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
>   

-- 
Scot P. Floess
27 Lake Royale
Louisburg, NC  27549

252-478-8087 (Home)
919-754-4592 (Work)

Chief Architect JPlate   http://sourceforge.net/projects/jplate
Chief Architect JavaPIM  http://sourceforge.net/projects/javapim

Architect Keros          http://sourceforge.net/projects/keros


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Copy content of file only?

Posted by Robin Chaddock <ro...@iplay.com>.
<copy file="A" tofile="B"/>
  ----- Original Message ----- 
  From: jonese 
  To: Ant Users List 
  Sent: Wednesday, February 13, 2008 3:43 PM
  Subject: Copy content of file only?


  Hey all i need to take the content of file A and place it into File B.
  anyone know the best way to accomplish this?

  jonese

  ---------------------------------------------------------------------
  To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
  For additional commands, e-mail: user-help@ant.apache.org


________________________________________________________________________
E-mail is an informal method of communication and may be subject to data corruption, interception and unauthorised amendment for which I-play, a trading name of Digital Bridges Ltd will accept no liability. Therefore, it will normally be inappropriate to rely on information contained on e-mail without obtaining written confirmation.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

(C) 2005. I-play is a trademark and trading name of Digital Bridges Limited. All Rights Reserved.
________________________________________________________________________
This message has been checked for all known viruses by the 
MessageLabs Virus Scanning Service. For further information visit
http://www.messagelabs.com/stats.asp