zoukankan      html  css  js  c++  java
  • Ant 替换某一文件中的字符串

    A.替换某一文件中的字符串

    <replace file ="base/testing.txt">
    token="@temp@"
    value="${newstring}"
    </replace>

    解释:token是需要替换的标记;value是新值,将testing.txt文件中的@temp@替换为新值。

    B.替换某个文件夹中存在特定标记的文件

    <replace dir="temp" token="@CHARSET@" value="${webapp.charset}"/>

    解释:temp目录中文件,如果有存在@CHARSET@标记的,将被替换为${webapp.charset}变量值。

    C.批量替换

    <replace dir="dist" includes="${app.project}.jad" encoding="UTF-8">

    <replacefilter token="@NAME@" value="${app.name}"/>
    <replacefilter token="@VENDOR@" value="${app.vendor}"/>
    <replacefilter token="@MIDLET@" value="${app.midlet}"/>
    <replacefilter token="@JAR@" value="${app.project}"/>
    <replacefilter token="@FILESIZE@" value="${size}"/>
    <replacefilter token="@DESCRIPTION@" value="${app.description}"/> <replacefilter token="@PRICE@" value="${app.price}"/>

    </replace>

  • 相关阅读:
    如何实现Iframe透明
    ListView(未完)
    我又回来了
    前言
    代码重用and思路重用
    图片上传
    千万数量级分页存储过程
    MSSQL中,将text,ntext转换为int型数据
    优秀的回复,来自圣殿骑士
    SqlDataSource控件
  • 原文地址:https://www.cnblogs.com/balaamwe/p/2382065.html
Copyright © 2011-2022 走看看