• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Ant has no robust insert capability

 
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, how else would you know *where* to insert your lines???
 
Saloon Keeper
Posts: 27762
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
James Ellis
Ranch Hand
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 205
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
We're all out of roofs. But we still have tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic