
[已解決]批處理或VBS如何實現對多個文本文件進查找替換字符串操作最后由 pcl_test 于 -7-15 13:07感謝apang的幫助!!根據a.txt中文件名依次修改相應文本內容。用sed、純批、VBS都行a.txt中內容為文件名如:599978.L599978.R、、文件內容相似如下:(以599978.L為例)
希望改后效果如下:nclick="copycode($('code0'));">復制代碼
- [EdgeCribbingTool]
- ToolSpeed=25000
- ToolSpeedMaster=25000
- Waviness=0.05
- [Generating]
- ToolSpeed=25000
- ToolSpeedMaster=25000
- Waviness=0.05
- [InitialData]
- Diameter=73
- Thickness=11.10
- [EdgeData]
- Type=circle
- Diameter=73
- 、
- 、
就像用VBA中有FOR遍歷,用IF判斷一樣(只是舉個例子,哪種方法快用哪種)nclick="copycode($('code1'));">復制代碼
- [EdgeCribbingTool]
- ToolSpeed=25000
- ToolSpeedMaster=25000
- Waviness=0.05
- [Generating]
- ToolSpeed=5000
- ToolSpeedMaster=25000
- Waviness=0.05
- [InitialData]
- Diameter=73
- Thickness=11.10
- [EdgeData]
- Type=circle
- Diameter=80
- 、
- 、
希望各位能幫忙,用sed,純批都行,謝謝!nclick="copycode($('code2'));">復制代碼
- for所有文件
- if文件名=599978.L then
- 條件1
- if 找到[Generating] then
- if 找到ToolSpeed then
- ToolSpeed=原來的值*0.2
- end if
- end if
- 條件2
- if 找到[EdgeData] then
- if 找到Diameter then
- Diameter=80
- end if
- end if
- 、
- 、
- 條件n
- if***then
- ****
- end if
- end if
- next

