【问题标题】:Adding tab spaces in a file using ant使用 ant 在文件中添加制表符空格
【发布时间】:2017-02-04 09:48:56
【问题描述】:

我们可以使用Ant 在文件中添加表格空间吗(例如使用echo 或其他东西)?

我有一个要求,我需要在单词之间有一个表格空格,并且我需要使用 Ant 创建这个文件。

【问题讨论】:

    标签: java apache ant


    【解决方案1】:

    试试这个技巧,定义一个选项卡变量并使用一个 html 十六进制实体。

    <?xml version="1.0" encoding="UTF-8"?>
    <project name="test" default="build" basedir=".">
    <property name="tab" value="&#x0009;" />
    <target name="build">
      <echo message="Run build task" />
    
      <echo message="file row 1${line.separator}" file="log.txt" append="false" encoding="UTF-8" />
      <echo message="file${tab}row${tab}2${line.separator}" file="log.txt" append="true" encoding="UTF-8" />
    </target>
    
    </project>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-25
      • 2021-06-08
      • 1970-01-01
      • 2023-01-27
      • 2013-10-22
      相关资源
      最近更新 更多