Board logo

标题: [文本处理] 求救,关于批处理命令 findstr 问题 [打印本页]

作者: qie2014    时间: 2014-12-29 16:52     标题: 求救,关于批处理命令 findstr 问题

现写了这段批处理
  1. @echo off
  2. ren C:\Users\%username%\.VirtualBox\VirtualBox.xml "VirtualBox.txt"
  3. call dateago.bat
  4. call get_current_time.bat
  5. set s=%DstDate%
  6. findstr /v %s% VirtualBox.txt>%short_date%.txt
  7. ren %short_date%.txt "VirtualBox.xml"
复制代码
以上思路测试成功,但还有几点需要升级,还请大神赐教。

注释,VirtualBox.xml文件里:
1229-23YQ-1
1229-9EQG-1
1229为日期,23YQ=A组,9EQG=B组,1-80为序号

目标效果:
1、4天前就是1225,删除带有序号17-80的整行(A和B组都要)
2、删除1230之后的所有数据(包括1230),例数据库里有121-110这41天的数据库,在1229这天,1230之后的全删除。




欢迎光临 批处理之家 (http://bbs.bathome.net/) Powered by Discuz! 7.2