- @echo off
- setlocal enabledelayedexpansion
- set "str=http://www.tiffany.com/Shopping/item.aspx?sku="
- findstr "%str%" a.txt >>b.txt
- findstr /v "%str%" a.txt >>f.txt
- for /f "tokens=2 delims==" %%i in (b.txt) do (
- echo %%i >>c.txt
- )
-
- for /f "tokens=1,2,3 delims==" %%a in (f.txt) do (
- if not "%%c" == "" (set str=%%b & set str=!str:^&cid=! & call echo %%str%% >>e.txt)
- )
- ping 127.1 -n 4 >nul
- del a.txt
- ren f.txt a.txt
- pause
复制代码 暂时可以生成a,b,c,e.txt。.d.txt也没生成,不过应该不难,而且我这个代码漏洞很大,只是根据你给的这几个来投机取巧弄的,还是用sed的那个好,不过我对sed不懂,看版主的没问题的话应该是没问题的
[ 本帖最后由 sgaizxt001 于 2010-4-5 06:57 编辑 ] |