标题: [文本处理] [已解决]求批处理根据a文件内容提取b文件内容 [打印本页]
作者: pdang 时间: 2013-5-12 15:40 标题: [已解决]求批处理根据a文件内容提取b文件内容
a.txt内- KB2670838
- KB2592687
- KB2476490
- KB2479943
- KB2484033
- KB2488113
- KB2491683
- KB2492386
- KB2503658
- KB2505438
- KB2506014
- KB2506212
- KB2506928
- KB2508429
- KB2509553
- KB2511250
- KB2511455
- KB2515325
- KB2522422
- KB2529073
- ..............N行
复制代码
b.txt文件内容如下- http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2475792-x64_2e8f675625883458482042e128f54167f0193f9b.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2425227-x64_0749e0e8531479e1de9347fe584e61d43c209c0f.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2485376-x64_7082a10a94b6cfffdd28f5f57f02e15a5345f5a7.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2479628-x64_a774713ef62d45373a08d4a7c0acfa18e8ec87c8.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2482017-x64_95006a2b965e8566d8a57600a0c0c53cb7212874.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2506212-x64_d23437b7902566fdc1ab3c972f38b3370a1f25a3.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2446710-x64_2df983290aec7bc15bcdf02722004c299e57c3b0.msu
- http://download.windowsupdate.com/msdownload/update/software/updt/2011/03/windows6.1-kb2511250-x64_460c30edb3e4257720b2fd96dc1e297b5912e29a.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2506223-x64_aa2472e1a5ca513ad87ee48bb666cff02474b30e.msu
- http://download.windowsupdate.com/msdownload/update/software/updt/2011/04/windows6.1-kb2492386-x64_c3ae664fc97ac46fc51d4b67dcad3b40b860af55.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2491683-x64_f33cff50cf92e0b8c0043f1ef3587661d600633e.msu
- http://download.windowsupdate.com/msdownload/update/software/crup/2011/03/windows6.1-kb2506014-x64_cc70f2accbfbae5e68f3c7aa3dba8877d1dc88a7.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2507618-x64_59ebfe1068e7e82a6eb74c2df33a6769af6dbbab.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2508272-x64_809a19099da4f25de9a33c233765d3969c0c6202.msu
- http://download.windowsupdate.com/msdownload/update/software/updt/2011/03/windows6.1-kb2505438-x64_068d9d60e103c9044b186c5dd3d9f5da9c9ead98.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2503658-x64_bbabf3cd4b9426b3ff04ee43c6a610ad91f35d4d.msu
- http://download.windowsupdate.com/msdownload/update/software/updt/2011/04/windows6.1-kb2506928-v2-x64_54e2c3d6b32d9ec399c2c4ace6f19018690156bd.msu
- http://download.windowsupdate.com/msdownload/update/software/crup/2011/05/windows6.1-kb2533552-x64_0ba5ac38d4e1c9588a1e53ad390d23c1e4ecd04d.msu
- http://download.windowsupdate.com/msdownload/update/software/crup/2011/03/windows6.1-kb2524375-x64_9293ad5e0fed616819818169518bef00c6219272.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/01/windows6.1-kb2479943-x64_2a683f1c9acb8b3c1fb480c1ff07a275267030ec.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2497640-x64_963f55e45c86cd263e7260e52691a749458ce49f.msu
- http://download.windowsupdate.com/msdownload/update/software/secu/2011/03/windows6.1-kb2509553-x64_48517ee2bd09479ad2d04c03e00f9b1460996469.msu
- ..................N行
复制代码
也就是b.txt内含有a.txt里的内容
提取到的内容输入到c.txt
作者: xxpinqz 时间: 2013-5-12 16:49
- @echo off
- (for /f "tokens=*" %%a in (a.txt) do echo %%~nxa)>$
- findstr /ig:$ b.txt >c.txt
- del $&start c.txt
复制代码
作者: pdang 时间: 2013-5-12 16:55
非常感谢xxpinqz 问题解决 抽空多向你学习批处理
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |