批处理修改XML一行内容
想修改MIDlet-Version的值。XML文件:
<?xml version="1.0" encoding="UTF-8"?>
<mani>
<ITEM name = "MIDlet-Icon" multi-lang = "false">/icon.png</ITEM>
<ITEM name = "MIDlet-Version" multi-lang = "false" fill = "version"></ITEM>
<ITEM name = "MIDlet-Vendor" multi-lang = "false">icetea</ITEM>
<ITEM name = "MicroEdition-Configuration" multi-lang = "false">CLDC-1.0</ITEM>
<ITEM name = "MicroEdition-Profile" multi-lang = "false">MIDP-2.0</ITEM>
</mani>
我的bat文件:
@echo off
echo "批处理修改xml文件"
setlocal enabledelayedexpansion
(for /f "delims=" %%i in ('type mani_template.xml') do (
set str=%%i
set str=!str:~0,-1!
echo !str!
if "!str!" equ " <ITEM name = "MIDlet-Version" multi-lang = "false" fill = "version"></ITEM" (
echo 找到这一行了
)
))
pause
想修改 MIDlet-Version的值 例如改为
<ITEM name = "MIDlet-Version" multi-lang = "false" fill = "version">"1111"</ITEM>
批处理 XML --------------------编程问答-------------------- 现在可以找到XML指定行,不清楚怎么改。
补充:移动开发 , Android