| creating files | creating files 2007-06-11 - By Rebhan, Gilbert
Hi,
-----Original Message----- From: arijit [mailto:ghosh.arijit@(protected)] Sent: Monday, June 11, 2007 1:27 PM To: user@(protected) Subject: RE: creating files
/* even if I load the property file, I can't see how I can read the key value pair from the property which is loaded and use it to replace the token with the read value... any sample code ? */
some snippets two propertysources, one file that is loaded via loadfile the entire file is loaded in one property, and another file in key=value format.
message.txt looks like the quick brown fox jumps over the lazy dog
props.txt looks like test.foo?r test.fooo?ar test.key1=bla test.key2=blabla test.multilinekey =\n line1 \ \n line 2 \ \n line 3 \ \n line 4 \
notice the \n line \ convention if you need multiline properties
<!-- // Properties --> <loadfile property="message" srcFile="Y:/message.txt"/> <property file="Y:/props.txt"/> <!-- Properties // -->
<target name="main" depends="depends">
<echo> $${message} = ${line.separator}${message}</echo> <echoproperties prefix="test"/> <echo>$${test.multilinekey} = ${test.multilinekey}</echo>
</target>
give you main: [echo] ${message} [echo] the quick [echo] brown [echo] fox [echo] jumps over [echo] the lazy [echo] dog [echoproperties] #Ant properties [echoproperties] #Mon Jun 11 14:06:39 CEST 2007 [echoproperties] test.key2=blabla [echoproperties] test.key1=bla [echoproperties] test.multilinekey=\n line1 \n line 2 \n line 3 \n line 4 [echoproperties] test.foo?r [echoproperties] test.fooo?ar [echo] ${test.multilinekey} [echo] line1 [echo] line 2 [echo] line 3 [echo] line 4 BUILD SUCCESSFUL Total time: 344 milliseconds
--------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@(protected) For additional commands, e-mail: user-help@(protected)
|
|
 |