gpt4 book ai didi

ant - Ant 如何将从文件中读取的值转换为属性值?

转载 作者:行者123 更新时间:2023-12-04 00:40:59 27 4
gpt4 key购买 nike

该文件如下所示:

a1,b1
a2,b2
...

我知道值“a2”。
如何将值“b2”转换为属性值。

我知道如何通过以下方式选择包含“a2”的行:
<linecontains>
<contains value="a2"/>
</linecontains>

但是 不知道如何将属性值设置为“b2”。
我随时为您提供更多其他信息。

最佳答案

以下对我有用:

<loadfile srcfile="data" property="result">
<filterchain>
<linecontains>
<contains value="a2"/>
</linecontains>
<tokenfilter>
<replacestring from="a2," to=""/>
</tokenfilter>
</filterchain>
</loadfile>
<echo message="${result}"/>

正如您所指出的,首先将选择“a2”行。然后 token 过滤器将 a2 和冒号替换为空。希望有帮助。

关于ant - Ant 如何将从文件中读取的值转换为属性值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/823909/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com