How can I force Ant to ignore blank lines when using tokens->file -
How can I force Ant to ignore blank lines when using tokens->file -
how can forcefulness ant ignore blank lines when reading files using tokens->file?
to more precise:
scripts.cfg ${dir.config} might contain lines file same name ./config/ folder. i'm using script determine whether lines/strings of 1 file exist in other one.
however: in case content of 1 file not exist in other, there shouldn't differences. nevertheless though ${ant.refid:to_be_removed.list} returns number of differences, due 1 of files (the input.list one) containing blank lines - , mark differences whatever reason.
i've tried using loadfile , tokenfilter, haven't been successful. way manages remove right lines (see code i've commented out @ end), removes blank lines, making file harder read. furthermore wanted able determine whether files have merged (= line count) using conditions along resourcecount-result. sadly resourcecount-id not 0, though there no differences blank lines.
any help appreciated! give thanks time!
<target name="removescriptlist" description="removes script entries"> <tokens id="input.list"> <file file="${dir.config}/scripts.cfg"/> </tokens> <tokens id="invalid.list"> <file file="./config/scripts.cfg"/> </tokens> <resourcecount property="to_be_removed.list.lines" count="0"> <intersect id="to_be_removed.list"> <resources refid="input.list"/> <resources refid="invalid.list"/> </intersect> </resourcecount> <difference id="clean.list"> <resources refid="input.list"/> <resources refid="to_be_removed.list"/> </difference> <pathconvert property="clean.prop" refid="clean.list" pathsep="${line.separator}"/> <echo>${to_be_removed.list.lines}</echo> <echo>${ant.refid:input.list}</echo> <!--<echo level="info" message="creating backup scripts.cfg"/> <copy file="${dir.config}/scripts.cfg" tofile="${dir.config}/scripts.cfg.bak" /> <echo file="${dir.config}/scripts.cfg">${clean.prop}</echo>--> </target>
try:
<loadfile property="mail.recipients" srcfile="recipientlist.txt"> <filterchain> <striplinebreaks/> </filterchain> </loadfile> ant
Comments
Post a Comment