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

[文本处理] [已解决]求批处理根据a文件内容提取b文件内容

a.txt内
  1. KB2670838   
  2. KB2592687   
  3. KB2476490   
  4. KB2479943   
  5. KB2484033   
  6. KB2488113   
  7. KB2491683   
  8. KB2492386   
  9. KB2503658   
  10. KB2505438   
  11. KB2506014   
  12. KB2506212   
  13. KB2506928   
  14. KB2508429   
  15. KB2509553   
  16. KB2511250   
  17. KB2511455   
  18. KB2515325   
  19. KB2522422   
  20. KB2529073  
  21. ..............N行
复制代码
b.txt文件内容如下
  1. http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2475792-x64_2e8f675625883458482042e128f54167f0193f9b.msu
  2. http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2425227-x64_0749e0e8531479e1de9347fe584e61d43c209c0f.msu
  3. http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2485376-x64_7082a10a94b6cfffdd28f5f57f02e15a5345f5a7.msu
  4. http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2479628-x64_a774713ef62d45373a08d4a7c0acfa18e8ec87c8.msu
  5. http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2482017-x64_95006a2b965e8566d8a57600a0c0c53cb7212874.msu
  6. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2506212-x64_d23437b7902566fdc1ab3c972f38b3370a1f25a3.msu
  7. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2446710-x64_2df983290aec7bc15bcdf02722004c299e57c3b0.msu
  8. http://download.windowsupdate.com/msdownload/update/software/updt/2011/03/windows6.1-kb2511250-x64_460c30edb3e4257720b2fd96dc1e297b5912e29a.msu
  9. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2506223-x64_aa2472e1a5ca513ad87ee48bb666cff02474b30e.msu
  10. http://download.windowsupdate.com/msdownload/update/software/updt/2011/04/windows6.1-kb2492386-x64_c3ae664fc97ac46fc51d4b67dcad3b40b860af55.msu
  11. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2491683-x64_f33cff50cf92e0b8c0043f1ef3587661d600633e.msu
  12. http://download.windowsupdate.com/msdownload/update/software/crup/2011/03/windows6.1-kb2506014-x64_cc70f2accbfbae5e68f3c7aa3dba8877d1dc88a7.msu
  13. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2507618-x64_59ebfe1068e7e82a6eb74c2df33a6769af6dbbab.msu
  14. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2508272-x64_809a19099da4f25de9a33c233765d3969c0c6202.msu
  15. http://download.windowsupdate.com/msdownload/update/software/updt/2011/03/windows6.1-kb2505438-x64_068d9d60e103c9044b186c5dd3d9f5da9c9ead98.msu
  16. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2503658-x64_bbabf3cd4b9426b3ff04ee43c6a610ad91f35d4d.msu
  17. http://download.windowsupdate.com/msdownload/update/software/updt/2011/04/windows6.1-kb2506928-v2-x64_54e2c3d6b32d9ec399c2c4ace6f19018690156bd.msu
  18. http://download.windowsupdate.com/msdownload/update/software/crup/2011/05/windows6.1-kb2533552-x64_0ba5ac38d4e1c9588a1e53ad390d23c1e4ecd04d.msu
  19. http://download.windowsupdate.com/msdownload/update/software/crup/2011/03/windows6.1-kb2524375-x64_9293ad5e0fed616819818169518bef00c6219272.msu
  20. http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2479943-x64_2a683f1c9acb8b3c1fb480c1ff07a275267030ec.msu
  21. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2497640-x64_963f55e45c86cd263e7260e52691a749458ce49f.msu
  22. http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2509553-x64_48517ee2bd09479ad2d04c03e00f9b1460996469.msu
  23. ..................N行
复制代码
也就是b.txt内含有a.txt里的内容
提取到的内容输入到c.txt
1

评分人数

    • Batcher: 感谢给帖子标题标注[已解决]字样PB + 2

非常感谢xxpinqz  问题解决  抽空多向你学习批处理

TOP

  1. @echo off
  2. (for /f "tokens=*" %%a in (a.txt) do echo %%~nxa)>$
  3. findstr /ig:$ b.txt >c.txt
  4. del $&start c.txt
复制代码
1

评分人数

初学BAT,非专业。代码不适当之处还望前辈们多多指点。在此表示感谢!

TOP

返回列表