|
zhouxiaohuanv
初级用户
积分 87
发帖 29
注册 2007-3-31
状态 离线
|
『楼 主』:
如何筛选包含特定代码的文件
在D:\sab\data\的所以TXT文件中如果有下面代码的就把他文件剪切到D:\trim文件夹中!
","","","","9","","",
[ Last edited by bjsh on 2007-5-10 at 07:32 PM ]
此帖被 -2 点积分 点击查看详情 评分人:【 bjsh 】 | 分数: -2 | 时间:2007-5-10 19:32 |
|
|
|
2007-5-10 15:58 |
|
|
zhoushijay
高级用户
Autowalk
积分 845
发帖 375
注册 2007-3-3
状态 离线
|
『第
2 楼』:
你是指 ","","","","9","","", 整个字符串还是指分号里面的
|
|
2007-5-10 17:16 |
|
|
zhouxiaohuanv
初级用户
积分 87
发帖 29
注册 2007-3-31
状态 离线
|
|
2007-5-10 19:22 |
|
|
lxmxn
版主
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第
4 楼』:
在命令行中输入
findstr /smrc:"\",\"\",\"\",\"\",\"9\",\"\",\"\"," D:\sab\data\*.txt 再根据得到的文件来处理吧。
由于被搜索字符串的特殊性,很难将结果导入文件或者用批处理脚本来写(我试了不下几十遍,均不成功),只能用findstr找出文件来。如果哪位达人可以批量处理这个问题的,不妨把具体方案放出来一起研究一下。
|
|
2007-5-10 23:49 |
|
|
zhouxiaohuanv
初级用户
积分 87
发帖 29
注册 2007-3-31
状态 离线
|
『第
5 楼』:
文件的情况是这样的
文件一就是想找出来的 ","","","","9","","","
"2VBSF0CNW00","","","","","4122300-SFJ7-W9-YR239L","","","","9","","","09/05/2007 18:34:36","010","172","","0","0","1","0","0","0","","0","","0","","0","","0","","0","000000","0","999999999999","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""
文件二
"2VBSF0CKJ00","","","","","4122300-SFJ7-W9-YR239L","","E07HF0CJV00","","9","","","09/05/2007 12:50:03","010","172","","0","0","1","0","0","0","","0","","0","","0","","0","","0","000000","0","999999999999","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","2"
他们的不同就在一文件","","","","9","","","
第二个文件","","E07HF0CJV00","","9","","","
E07HF0CJV00是可以变化的~
|
|
2007-5-11 11:10 |
|
|
lxmxn
版主
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第
6 楼』:
用grep试试
Re zhouxiaohuanv:
grep -no "4122300-SFJ7-W9-YR239L.*09/05/2007" *.txt
|
|
2007-5-11 17:54 |
|
|