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

[文本处理] 能用批处理读取指定文本并按要求增减或替换字符吗?

[复制链接]
发表于 2012-5-20 15:51:50 | 显示全部楼层 |阅读模式
网站程序装几个插件,需要修改原网页代码才能实现插件效果!


假设文本文件中如下代码:
  1.         B.toolbarCommands = {
  2.                 boldIcon: ['Bold', '粗体', iconUI, ToggleCommandController, 'command'],
  3.                 italicIcon: ['Italic', '斜体', iconUI, ToggleCommandController, 'command'],
  4.                 underlineIcon: ['Underline', '下划线', iconUI, ToggleCommandController, 'command'],
  5.                 strikethroughIcon: ['Strikethrough', '删除线', iconUI, ToggleCommandController, 'command'],
  6.                 removeformat: ['RemoveFormat', '清除样式', iconUI, CommandController, 'command'],
  7.                 leftIcon: ['JustifyLeft', '左对齐',  iconUI, ToggleCommandController, 'command'],
  8.                 rightIcon: ['JustifyRight', '右对齐', iconUI, ToggleCommandController, 'command'],
  9.                 centerIcon: ['JustifyCenter', '居中对齐', iconUI, ToggleCommandController, 'command'],
  10.                 fullIcon: ['JustifyFull', '两端对齐', iconUI, ToggleCommandController, 'command'],
  11.                 imageIcon:  ['Image', '图片', iconUI, InsertCommandController, 'insertCommand'],
  12.                 foreColor:  ['Forecolor', '文字颜色', colorUI, ColorSelectorController, 'valueCommand', '#FF0000'],
  13.                 backColor: [B.UA.ie ? 'Backcolor' : 'hilitecolor', '背景色',  colorUI, ColorSelectorController, 'valueCommand', '#FFFF00'],
  14.                 olIcon: ['InsertOrderedList', '编号',    iconUI, CommandController, 'command'],
  15.                 ulIcon: ['InsertUnorderedList', '项目符号',    iconUI, CommandController, 'command'],
  16.                 indentIcon: ['Indent', '缩进',    iconUI, CommandController, 'wrapCommand'],
  17.                 outdentIcon: ['Outdent', '取消缩进',    iconUI, CommandController, 'command'],
  18.                 hrIcon: ['Inserthorizontalrule',      '分隔线',  iconUI, CommandController, 'command'],
  19.                 quoteIcon: ['blockquote',    '插入引用',    iconUI, InsertCommandController, 'insertCommand'],
  20.                 codeIcon: ['code',           '插入代码',    iconUI, InsertCommandController, 'insertCommand'],
  21.                 linkIcon: ['createLink',    '插入链接',  iconUI, InsertCommandController, 'command'],
  22.                 unlinkIcon: ['Unlink',        '取消链接', iconUI, CommandController, 'command'],
  23.                 tableIcon: ['inserttable',   '插入表格',    iconUI,  InsertCommandController, 'insertCommand'],
  24.                 faceBtn: ['emotional', '表情', buttonUI, PluginCommandController, 'insertCommand'],
  25.                 photoBtn: ['insertImage', '图片', buttonUI, PluginCommandController, 'insertCommand'],
  26.                 fileBtn: ['insertAttach', '附件', buttonUI, PluginCommandController, 'insertCommand'],
  27.                 videoBtn: ['insertvideo', '视频', buttonUI, InsertCommandController, 'insertCommand'],
  28.                 musicBtn: ['insertmusic', '音乐', buttonUI, InsertCommandController, 'insertCommand'],
  29.                 sellIcon: ['sell', '插入出售', iconUI, PluginCommandController, 'insertCommand'],
  30.                 postIcon: ['post', '插入隐藏', iconUI, PluginCommandController, 'insertCommand'],
  31.                 pwcodeIcon: ['pwcode', '自定义代码', iconUI, PluginCommandController, 'insertCommand'],
  32.                 setformIcon: ['setform', '帖子格式', iconUI, PluginCommandController, 'insertCommand'],
  33.                 undoIcon: ['undo', '撤销', iconUI, CommandController, 'command'],
  34.                 redoIcon: ['redo', '恢复', iconUI, CommandController, 'command'],
  35.                 pgformatIcon: ['PgFormat', '段落化', iconUI, CommandController, 'command'],
  36.                 fontSelector: ['FontName',      '字体',    selectorUI, ValueSelectorController, 'valueCommand',
复制代码
  1. 用批处理读取读取该文本文件,读取至
  2.                 photoBtn: ['insertImage', '图片', buttonUI, PluginCommandController, 'insertCommand'],

  3. 在这段代码下面添加一行代码:
  4.                 downsBtn: ['insertdowns', '下载', buttonUI, InsertCommandController, 'insertCommand'],
复制代码
  1. 然后继续往下读取至:
  2.                 musicBtn: ['insertmusic', '音乐', buttonUI, InsertCommandController, 'insertCommand'],

  3. 在这段代码下面添加一行代码:
  4.                 downsBtn: ['insertdowns', '下载', buttonUI, InsertCommandController, 'insertCommand'],
复制代码
  1. 然后继续往下读取至:
  2.                 pwcodeIcon: ['pwcode', '自定义代码', iconUI, PluginCommandController, 'insertCommand'],

  3. 将这段代码替换成:
  4.                 downsBtn: ['insertdowns', '下载', buttonUI, InsertCommandController, 'insertCommand'],
复制代码
不知道是否能用批处理读取指定文本并按要求增减或替换字符?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2026-3-19 06:04 , Processed in 0.017965 second(s), 8 queries , File On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

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