标题: 求个文本内容指定数字可以累计+1的批处理
[打印本页]
作者: yxzpt
时间: 2009-5-15 09:16
标题: 求个文本内容指定数字可以累计+1的批处理
文本如下,求每运行1次,可以使红色部分数字+1的批处理
GOER /index.php/itemshop/addSkuShop/
6306 HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, */*
Referer:
http://www.btll.com/index.php/itemshop/addSkuShopStep1/6306
Accept-Language: zh-cn
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.0.3705; .NET CLR 1.1.4322; TheWorld)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host:
www.btll.com
Content-Length: 917
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: wigix_wigix_rememberme=0487822; WIGIXSESSID=361b8f418d52dd1a46febdad0684be8f; __utma=97756234.2184038001970084300.1240487822.1241615808.1242134986.8; __utmz=97756234.1240487822.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none); ystat_bc_970902=527221676530442127; __utmb=97756234.15.10.1242134986; __utmc=97756234; ystat_ss_970902=14_1242164111_3443857828
shop_name=&traditional_shop_province=0&traditional_shop_city=0&traditional_shop_address=&traditional_shop_other=&traditional_attribute1_selected_value=0&traditional_attribute2_selected_value=0&traditional_attribute3_selected_value=0&traditional_shop_comment_content=
作者: netbenton
时间: 2009-5-15 10:01
GOER /index.php/itemshop/addSkuShop/6306 HTTP/1.1
此句在文中的其它地方还有第二吗?
如果没有了,这样就可以了:
::txtadd.txt 为源文件
@echo off
(for /f "delims=" %%a in (txtadd.txt) do (
set str=%%a
setlocal enabledelayedexpansion
if "!str:~,36!" equ "GOER /index.php/itemshop/addSkuShop/" (
for /f "tokens=1,2" %%b in ("!str!") do (
set/a n=%%~nc+1
for %%d in (!n!) do (set str=!str:%%~nc=%%d!)
) )
echo !str!
endlocal
))>de.tmp
type de.tmp>txtadd.txt
del /q de.tmp
pause
作者: yxzpt
时间: 2009-5-15 10:15
谢谢你的帮助,确实可以+1,但是运行后,内容中的空行就没有了
作者: yishanju
时间: 2009-5-15 10:46
楼主 能顺便介绍下你都用什么抓包工具,用什么工具向服务器提交这些包
我一直都在找好用的工具。
作者: tireless
时间: 2009-5-15 11:22
@echo off
set file="a.txt"
for /f "delims=: tokens=1,*" %%a in ('findstr /n .* %file%') do (
if not defined var (
set var=%%b
setlocal enabledelayedexpansion
set /a n=!var:~36,-9!+1
>%file% echo !var:~,36!!n!!var:~-9!
setlocal disabledelayedexpansion
) else >>%file% echo.%%b
)
@echo off
set File="a.txt"
set /p str=<%File%
set /a n=%str:~36,-9%+1
(echo %str:~,36%%n%%str:~-9%
more +1 %File%)>.new
move .new %File%
[
Last edited by tireless on 2009-5-15 at 11:23 ]