是否可以使用 ant 任务在 mqfte 中修改文件的内容?
我必须在 txt 文件的内容中用字母“C”替换字母“A”。
令 test.txt 为 txt 文件。内容如下:
Ace Apple
我需要目标文件夹中的内容为:
Cce Cpple。
在使用 ant 任务的 mqfte 中这可能吗?
I have to substitute the letter "A" with letter "C" in the content of a txt file.
Let test.txt be a txt file. The content is as follows:
Ace Apple
I need the content in the destination folder to be as :
Cce Cpple.
Is this possible in mqfte using ant tasks?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答是“是”。
更长的答案是,您可以使用 Ant 执行任何可以编写脚本的操作,包括调用其他脚本。该方法是使用目的地后调用,在文件到达后对其进行编辑。如果文件传输失败,则不会触发此调用。如果传输成功,后目的地调用将触发,并将运行您的任务或脚本来编辑文件。请记住,如果您将其配置为作为监视器运行,它将在每次文件传输时触发。如果您想将其作为临时传输运行,则需要从命令行提交它,因为 GUI 不支持预/后调用。
The short answer is "yes."
The longer answer is that you can do anything with Ant that can be scripted, including calling other scripts. The approach would be to use a post-destination call that would edit the file after it arrives. This call won't fire if the file transfer fails. If the transfer succeeds the post-destination call does fire and will run your task or script to edit the file. Just remember that if you configure this to run as a monitor, it will fire on every file transfer. If you want to run it as an ad-hoc transfer you will need to submit it from the command line since the GUI does not support the pre/post calls.