[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖

[文本处理] 如何删除/排除文本文档中特定内容行

比如附件VFT_01中,需要删除其中内容为: Date;Time;MID;"Machine state";"Sub state";Job;"Lens side";Comment的行和空的行,谢谢各位老师了.
原内容:
Date;Time;MID;"Machine state";"Sub state";Job;"Lens side";Comment
2015_11_21;05:17:27,742;rogramStart;--------;--------;--------;--------
2015_11_21;05:17:27,742;;NotReady;;;;
2015_11_21;05:17:48,602;;Error;;;;
2015_11_21;05:21:33,475;;NotReady;;;;
2015_11_21;05:21:45,562;;Error;;;;
2015_11_21;05:32:27,495;;NotReady;;;;
2015_11_21;05:33:01,324;;Error;;;;
2015_11_21;05:33:06,882;;NotReady;;;;
2015_11_21;05:35:54,082;;Error;;;;
2015_11_21;05:35:55,825;;NotReady;;;;
2015_11_21;05:36:47,579;;Error;;;;
2015_11_21;05:36:57,323;;NotReady;;;;
2015_11_21;05:38:00,975;;Error;;;;
2015_11_21;05:38:06,943;;NotReady;;;;
2015_11_21;05:40:46,293;;ProgramEnd;--------;--------;--------;--------
2015_11_21;05:44:05,722;;ProgramStart;--------;--------;--------;--------
2015_11_21;05:44:05,722;;NotReady;;;;
2015_11_21;05:44:55,573;;Error;;;;
2015_11_21;05:44:58,648;;ManualMode;;;;
2015_11_21;05:47:51,787;;NotReady;;;;
2015_11_21;05:48:36,160;;Error;;;;
2015_11_21;05:48:53,165;;ManualMode;;;;

Date;Time;MID;"Machine state";"Sub state";Job;"Lens side";Comment
2015_11_23;14:41:17,763;;Error;;;;

Date;Time;MID;"Machine state";"Sub state";Job;"Lens side";Comment
2015_11_24;04:55:50,370;;NotReady;;;;
2015_11_24;06:27:00,551;;ProgramStart;--------;--------;--------;--------
2015_11_24;06:27:00,561;;NotReady;;;;
2015_11_24;06:28:03,342;;WaitingForJobs;;;;
2015_11_24;06:28:22,109;;ManualMode;;;;
2015_11_24;06:29:01,365;;NotReady;;;;
2015_11_24;06:29:03,698;;ManualMode;;;;
2015_11_24;06:29:53,770;;NotReady;;;;
2015_11_24;06:29:57,025;;ManualMode;;;;

VBS改好后的内容为:
2015_11_21;05:17:27,742;;ProgramStart;--------;--------;--------;--------
2015_11_21;05:17:27,742;;NotReady;;;;
2015_11_21;05:17:48,602;;Error;;;;
2015_11_21;05:21:33,475;;NotReady;;;;
2015_11_21;05:21:45,562;;Error;;;;
2015_11_21;05:32:27,495;;NotReady;;;;
2015_11_21;05:33:01,324;;Error;;;;
2015_11_21;05:33:06,882;;NotReady;;;;
2015_11_21;05:35:54,082;;Error;;;;
2015_11_21;05:35:55,825;;NotReady;;;;
2015_11_21;05:36:47,579;;Error;;;;
2015_11_21;05:36:57,323;;NotReady;;;;
2015_11_21;05:38:00,975;;Error;;;;
2015_11_21;05:38:06,943;;NotReady;;;;
2015_11_21;05:40:46,293;;ProgramEnd;--------;--------;--------;--------
2015_11_21;05:44:05,722;;ProgramStart;--------;--------;--------;--------
2015_11_21;05:44:05,722;;NotReady;;;;
2015_11_21;05:44:55,573;;Error;;;;
2015_11_21;05:44:58,648;;ManualMode;;;;
2015_11_21;05:47:51,787;;NotReady;;;;
2015_11_21;05:48:36,160;;Error;;;;
2015_11_21;05:48:53,165;;ManualMode;;;;
2015_11_23;14:41:17,763;;Error;;;;
2015_11_24;04:55:50,370;;NotReady;;;;
2015_11_24;06:27:00,551;;ProgramStart;--------;--------;--------;--------
2015_11_24;06:27:00,561;;NotReady;;;;
2015_11_24;06:28:03,342;;WaitingForJobs;;;;
2015_11_24;06:28:22,109;;ManualMode;;;;
2015_11_24;06:29:01,365;;NotReady;;;;
2015_11_24;06:29:03,698;;ManualMode;;;;
2015_11_24;06:29:53,770;;NotReady;;;;
2015_11_24;06:29:57,025;;ManualMode;;;;
1

评分人数

    • pcl_test: 发帖前先使用论坛搜索PB -2

回复 3# sun_java1984


    VBS的问题怎么在BAT版块发帖?
Talk is cheap. Show me the code.
没事不要瞎扯淡,有能耐就把代码贴出来给我看。

TOP

谢谢gawk , 能否用VBS来实现?

TOP

  1. findstr "^[0-9]" "VFT_01.txt" > "VFT_02.txt"
复制代码
Talk is cheap. Show me the code.
没事不要瞎扯淡,有能耐就把代码贴出来给我看。

TOP

返回列表