aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes replaceToken with multiple lines 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 "replaceToken with multiple lines" Watch "replaceToken with multiple lines" New topic
Author

replaceToken with multiple lines

James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
I want to copy a .sql file and replace a token within the file with several lines of text. Unfortunately I can't figure out the newline character I'm supposed to be using. Here is what's happening.

In the build.xml file I have the following:



And in the .sql file where I want to be inserting the text - after running the Ant script I get the following:



Obviously the does nothing to print a newline in the .sql file. How can I print multiple lines of text in this file using one property?
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
Try ${line.separator} ...


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
James Ellis
Ranch Hand

Joined: Oct 14, 2004
Posts: 205
Ilja,

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
Ilja Preuss
author
Sheriff

Joined: Jul 11, 2001
Posts: 14112
You're very welcome!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: replaceToken with multiple lines
 
Similar Threads
my servlet can't initialize: null
Selecting and inserting input object using Jquery
Hibernate with HSQLdb - SQLException requires collation in statement
Ant has no robust insert capability
replaceregexp workaround/bug