[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
本帖最后由 weichenxiehou 于 2012-7-2 08:55 编辑
  1. @echo off
  2. :aa
  3. set /p name=输入姓名(多个姓名用空格分隔):
  4. set /p t=查询次数:
  5. set n=
  6. findstr "%name%" 412.txt > temp.txt
  7. for %%i in (%name%) do cd.>%%i.txt
  8. :bb
  9. set /p ri=只搜索日期(两位数):
  10. for %%i in (%name%) do (
  11.   findstr "[0-9][0-9][0-9][0-9]-[0-9][0-9]-%ri%" temp.txt >> %%i.txt && echo 查到%%i%ri%号的消费记录 || echo 没有找到%%i%ri%号的消费记录>>%%i.txt
  12. )
  13. echo 查询别的日期
  14. set/a n+=1
  15. if %n% equ %t% del temp.txt&goto :eof
  16. goto bb
复制代码
看得多说得多,远比不上写得多。

TOP

  1. @echo off
  2. :aa
  3. cls
  4. set /p name=输入姓名(多个姓名用空格分隔):
  5. set /p ri=只搜索日期(两位数):
  6. for %%i in (%name%) do (
  7.   cd.>%%i.txt
  8.   (findstr "[0-9][0-9][0-9][0-9]-[0-9][0-9]-%ri%" 412.txt && echo 查到%%i%ri%号的消费记录 || echo 没有找到%%i%ri%号的消费记录)>%%i.txt
  9. )
  10. goto aa
复制代码
看得多说得多,远比不上写得多。

TOP

返回列表