File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

replaceToken with multiple lines

 
James Ellis
Ranch Hand
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try ${line.separator} ...
 
James Ellis
Ranch Hand
Posts: 205
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're very welcome!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic