Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I force Ant to ignore blank lines when using tokens->file
    primarykey
    data
    text
    <p><strong>How can I force Ant to ignore blank lines when reading files using tokens->file?</strong></p> <p><em>To be more precise:</em></p> <p><strong>scripts.cfg</strong> from <strong>${dir.config}</strong> might contain lines from a file with the same name from <strong>./config/</strong> folder. I'm using this script to determine whether lines/strings of one file exist in the other one.</p> <p>However: in case content of one file does not exist in the other, there shouldn't be any differences. Nevertheless though <strong>${ant.refid:to_be_removed.list}</strong> returns a number of differences, which is probably due to one of those files (the input.list one) containing blank lines - and it does mark those as <em>differences</em> for whatever reason.</p> <p>I've tried using loadfile and tokenfilter, but I haven't been successful. The way it is now it actually manages to remove the correct lines (see code I've commented out at the end), but it also removes all blank lines, making the file harder to read. Furthermore I <em>wanted to be able to determine whether files have to be merged (= line count)</em> by using <strong>conditions</strong> along with a <strong>resourcecount</strong>-result. Sadly this resourcecount-Id is not 0, even though there are no differences but the blank lines.</p> <p>Any help is greatly appreciated! Thank you for your time!</p> <pre><code>&lt;target name="removeScriptList" description="removes script entries"&gt; &lt;tokens id="input.list"&gt; &lt;file file="${dir.config}/scripts.cfg"/&gt; &lt;/tokens&gt; &lt;tokens id="invalid.list"&gt; &lt;file file="./config/scripts.cfg"/&gt; &lt;/tokens&gt; &lt;resourcecount property="to_be_removed.list.lines" count="0"&gt; &lt;intersect id="to_be_removed.list"&gt; &lt;resources refid="input.list"/&gt; &lt;resources refid="invalid.list"/&gt; &lt;/intersect&gt; &lt;/resourcecount&gt; &lt;difference id="clean.list"&gt; &lt;resources refid="input.list"/&gt; &lt;resources refid="to_be_removed.list"/&gt; &lt;/difference&gt; &lt;pathconvert property="clean.prop" refid="clean.list" pathsep="${line.separator}"/&gt; &lt;echo&gt;${to_be_removed.list.lines}&lt;/echo&gt; &lt;echo&gt;${ant.refid:input.list}&lt;/echo&gt; &lt;!--&lt;echo level="info" message="Creating backup scripts.cfg"/&gt; &lt;copy file="${dir.config}/scripts.cfg" tofile="${dir.config}/scripts.cfg.bak" /&gt; &lt;echo file="${dir.config}/scripts.cfg"&gt;${clean.prop}&lt;/echo&gt;--&gt; &lt;/target&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload