ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE : using RE with newline problem
Date Wed, 12 Mar 2008 07:58:03 GMT

/*
        <loadfile srcfile="file.txt" property="temp.param">
                <filterchain>
                        <linecontains>
                                <contains value="key = "/>
                        </linecontains>
                        <tokenfilter>
                                <stringtokenizer delims="="/>
                                <replaceregex pattern="('{1})"
replace=""/>
                                <replaceregex pattern="('{1})"
replace=""/>
                                <replaceregex pattern="key" replace=""/>
                                <replaceregex
pattern="${line.separator}"
replac
e="" /><!-- newly added line to eliminate new line or CR -->
                        </tokenfilter>
                        <tokenfilter>
                                <replacestring from="=" to=""/>
                        </tokenfilter>
                        <trim/>
                </filterchain>
        </loadfile>

/*

use =

<loadfile srcfile="key_value.txt" property="temp.param">
  <filterchain>
    <tokenfilter>
      <replaceregex pattern="^.+='?(\d|\w+)'?$" replace="\1"/>
    </tokenfilter>
    <striplinebreaks/>
  </filterchain>
</loadfile>


but if you use striplinebreaks you get =

<echo>$${temp.param} == ${temp.param}</echo>

${temp.param} == valuevalue1value2

Is that really what you want ??


Regards,
Gilbert

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message