找回密码
 注册
搜索
[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
查看: 82915|回复: 16

[文本处理] [已解决]如何用bat删除xml里的指定行?

[复制链接]
发表于 2013-9-7 09:23:31 | 显示全部楼层 |阅读模式
本帖最后由 pcl_test 于 2016-5-7 14:03 编辑

我这里有个xml文件,我需要删除6217这一行:<public type="mipmap" name="sym_app_on_sd_unavailable_icon" id="0x010d0001" />   <public type="interpolator" name="accelerate_quad" id="0x010c0000" />
    <public type="interpolator" name="decelerate_quad" id="0x010c0001" />
    <public type="interpolator" name="accelerate_cubic" id="0x010c0002" />
    <public type="interpolator" name="decelerate_cubic" id="0x010c0003" />
    <public type="interpolator" name="accelerate_quint" id="0x010c0004" />
    <public type="interpolator" name="decelerate_quint" id="0x010c0005" />
    <public type="interpolator" name="accelerate_decelerate" id="0x010c0006" />
    <public type="interpolator" name="anticipate" id="0x010c0007" />
    <public type="interpolator" name="overshoot" id="0x010c0008" />
    <public type="interpolator" name="anticipate_overshoot" id="0x010c0009" />
    <public type="interpolator" name="bounce" id="0x010c000a" />
    <public type="interpolator" name="linear" id="0x010c000b" />
    <public type="interpolator" name="cycle" id="0x010c000c" />
    <public type="mipmap" name="sym_def_app_icon" id="0x010d0000" />
    <public type="mipmap" name="sym_app_on_sd_unavailable_icon" id="0x010d0001" />
    <public type="integer" name="config_shortAnimTime" id="0x010e0000" />
    <public type="integer" name="config_mediumAnimTime" id="0x010e0001" />
    <public type="integer" name="config_longAnimTime" id="0x010e0002" />
    <public type="integer" name="status_bar_notification_info_maxnum" id="0x010e0003" />
    <public type="integer" name="config_soundEffectVolumeDb" id="0x010e0004" />
    <public type="integer" name="config_lockSoundVolumeDb" id="0x010e0005" />
    <public type="integer" name="config_activityShortDur" id="0x010e0006" />
    <public type="integer" name="config_activityDefaultDur" id="0x010e0007" />
    <public type="integer" name="config_radioScanningTimeout" id="0x010e0008" />
    <public type="integer" name="config_networkTransitionTimeout" id="0x010e0009" />
    <public type="integer" name="config_max_pan_devices" id="0x010e000a" />

大大们帮帮忙吧!

评分

参与人数 2PB -4 收起 理由
pcl_test -6 未按版规发帖
Batcher + 2 感谢给帖子标题标注[已解决]字样

查看全部评分

发表于 2013-9-7 10:15:59 | 显示全部楼层
永远都只会求助?不会自己动手尝试?
 楼主| 发表于 2013-9-7 10:23:54 | 显示全部楼层
我试了的,不得行呀
发表于 2013-9-7 11:07:12 | 显示全部楼层
回复 3# ttrrf


    请把你尝试过的代码贴出来,我可以帮忙修改。
 楼主| 发表于 2013-9-7 11:10:06 | 显示全部楼层
回复 4# Batcher

type arrays.xml|findstr /v /i "zh_tw 绻侀珨涓?枃">new.xml
发表于 2013-9-7 11:13:24 | 显示全部楼层
回复 5# ttrrf


http://www.bathome.net/thread-26230-1-1.html
这个帖子也是你发的对吧?
虽然你付钱给人家了,但是不能指望那一条命令能够解决所有的问题。
你至少要搞清楚那条命令是什么意思嘛
 楼主| 发表于 2013-9-7 11:17:28 | 显示全部楼层
回复 6# Batcher

我以知道了,是删除字符串的代码,是不?那以上的如何删除呢?请指教下!
发表于 2013-9-7 11:17:31 | 显示全部楼层
  1. findstr /v "sym_app_on_sd_unavailable_icon..id=.0x010d0001" public.xml > public_new.xml
复制代码
 楼主| 发表于 2013-9-7 11:28:18 | 显示全部楼层
回复 8# Batcher


    能否把代码改下,我是在public.xml的上一级目录里,如果要删除public.xml里的某一行后,重命名public_new.xml后再命名回public.xml。如何做呢?
发表于 2013-9-7 11:33:26 | 显示全部楼层
回复 9# ttrrf


    上一级目录叫什么名字?
 楼主| 发表于 2013-9-7 12:53:12 | 显示全部楼层
回复 10# Batcher


        你随便给个名字吧!我在外面的。
发表于 2013-9-7 12:59:17 | 显示全部楼层
回复 11# ttrrf
  1. @echo off
  2. pushd 随便给个名字
  3. findstr /v "sym_app_on_sd_unavailable_icon..id=.0x010d0001" public.xml > public_new.xml
  4. move /y public_new.xml public.xml
  5. popd
复制代码
 楼主| 发表于 2013-9-7 13:18:48 | 显示全部楼层
回复 12# Batcher


    pushd后面能否是一个路径?
发表于 2013-9-7 13:26:54 | 显示全部楼层
回复 13# ttrrf


    表示无语.......菜鸟路过~pushd后面本来就是一个路径~
这种问题你完全可以在cmd下输入pushd/?查看下帮助~....
 楼主| 发表于 2013-9-7 13:33:11 | 显示全部楼层
回复 14# 林小七


    我没在电脑旁好不好!
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|批处理之家 ( 渝ICP备10000708号 )

GMT+8, 2026-3-17 20:04 , Processed in 0.021232 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表