我如何提取一个蚂蚁CSV财产1个元素 [英] how do I extract the 1st element from a ant CSV property
问题描述
给予CSV ant属性,
given a CSV ant property,
<property name="module.list" value="mod1,mod2,mod3,mod4,mod5"/>
我怎么能只得到第一个元素(即MOD1在这里)?我想执行一个命令,将在MOD1作为其中一个参数。
how can I just get the first element (ie "mod1" here)? I want to execute a command that will take in "mod1" as one of the arguments.
此外..我不能修改这个原来的module.list属性列表,或其他任何东西。虽然我可以在此创建另一个列表,物业等。
Moreover.. I cannot modify this original "module.list" property to a list or anything else.. although I can create another list,property,etc from this..
任何帮助是pciated AP $ P $ ..
谢谢
Any help is appreciated.. Thanks
推荐答案
您也可以看看蚂蚁的Contrib任务和foreach,如果你想使用的所有变量。
You can also take a look at Ant-Contrib tasks for and foreach, if you want to use all variables.
<echo message="The first five letters of the alphabet are:"/>
<for list="a,b,c,d,e" param="letter">
<sequential>
<echo>Letter @{letter}</echo>
</sequential>
</for>
http://ant-contrib.sourceforge.net/tasks/tasks/ index.html的
为了用户的任务,不要忘了申报这项任务DEF:
In order to user For Task, don't forget to declare this task def :
<taskdef resource="net/sf/antcontrib/antlib.xml" />
这篇关于我如何提取一个蚂蚁CSV财产1个元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!