Ant 遍历文件并搜索表达式
Ant Iterate through files and search for expressions
在 Ant 中,我想遍历文件并在每个文件的内容中寻找一些正则表达式。我想从正则表达式的匹配中创建一个新文件。
即。我有 3 个文件:
A.txt
<root>
<node type="com.module.SomeModule" />
<node name="Test" />
</root>
B.txt
<root>
<node name="Apple" />
<node type="com.module.SomeModule2" />
<node type="com.module.SomeModule3" />
<strangenode id="green" />
</root>
C.txt
<root>
<node name="Apple" />
<strangenode id="green" />
</root>
我想创建一个这样的文件:
references.txt
com.module.SomeModule
com.module.SomeModule2
com.module.SomeModule3
非常感谢!
使用从 XSLT 输出的文件集中的 XSLT task to parse the XML and generate a set of files containing the desired values, then use concat task 到 assemble references.txt
。
在 Ant 中,我想遍历文件并在每个文件的内容中寻找一些正则表达式。我想从正则表达式的匹配中创建一个新文件。
即。我有 3 个文件:
A.txt
<root>
<node type="com.module.SomeModule" />
<node name="Test" />
</root>
B.txt
<root>
<node name="Apple" />
<node type="com.module.SomeModule2" />
<node type="com.module.SomeModule3" />
<strangenode id="green" />
</root>
C.txt
<root>
<node name="Apple" />
<strangenode id="green" />
</root>
我想创建一个这样的文件:
references.txt
com.module.SomeModule
com.module.SomeModule2
com.module.SomeModule3
非常感谢!
使用从 XSLT 输出的文件集中的 XSLT task to parse the XML and generate a set of files containing the desired values, then use concat task 到 assemble references.txt
。