aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Ant has no robust insert capability Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Ant has no robust insert capability" Watch "Ant has no robust insert capability" New topic
Author

Ant has no robust insert capability

James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
From what I have found, there really is no way in Ant's core tasks to insert several lines of text into a file without placing a token for each line you are going to insert. Is this correct or can anyone provide a way to do this?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Well, how else would you know *where* to insert your lines???


The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15646
    
  15

Other than a marker, the only way I can think of is to keep the file in parts and use Ant's file concatenator.

Or is it appender? I forget.
[ January 05, 2005: Message edited by: Tim Holloway ]

Customer surveys are for companies who didn't pay proper attention to begin with.
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Ilja,

It would be nice if you could insert MULTIPLE lines where this token is. Currently you can only insert one line of text per token. Unless you know otherwise...
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Ilja,

Just read your earlier post (same forum). Thanks so much. I'll post the solution here for anyone else interested.

I am creating an application using tomcat and mysql. Each customer will get a copy of tomcat with the java code and MySQL with the tables including their accounts/passwords stored in the tables. For each customer we will have a different .sql file to build the database and thus we'll have different sql statements to create accounts for these users.

So...I need to insert into the .sql file some SQL statements to create the accounts for this customer. So in the build.xml file I will have something like this:





and in the install_tables.sql file where I place the token



Ant will replace with the insert statements...on MULTIPLE lines.

The


is the key.


Thank you very much,
Jim
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ant has no robust insert capability
 
Similar Threads
reading a very complex file and inserting in database
EJB3 -> Best optimizzed way for bulk insert ?
problem insert with DB2
TextField in JTable
Game on SQL