中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-08-11 19:45
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » 求个文本内容指定数字可以累计+1的批处理 查看 725 回复 4
楼 主 求个文本内容指定数字可以累计+1的批处理 发表于 2009-05-15 09:16 ·  中国 江苏 南京 电信
初级用户
积分 60
发帖 29
注册 2007-04-28 22:37
19年会员
UID 86809
性别 男
状态 离线
文本如下,求每运行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=
2 发表于 2009-05-15 10:01 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
积分 1,916
发帖 752
注册 2008-12-28 04:30
17年会员
UID 135147
性别 男
来自 广西
状态 离线
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
精简
=> 个人网志
3 发表于 2009-05-15 10:15 ·  中国 江苏 南京 电信
初级用户
积分 60
发帖 29
注册 2007-04-28 22:37
19年会员
UID 86809
性别 男
状态 离线
谢谢你的帮助,确实可以+1,但是运行后,内容中的空行就没有了
4 发表于 2009-05-15 10:46 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
积分 1,488
发帖 1,357
注册 2006-05-20 12:00
20年会员
UID 55770
状态 离线
楼主 能顺便介绍下你都用什么抓包工具,用什么工具向服务器提交这些包
我一直都在找好用的工具。

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
5 发表于 2009-05-15 11:22 ·  中国 江西 赣州 电信
银牌会员
★★★★
积分 2,025
发帖 1,122
注册 2007-09-05 20:15
18年会员
UID 96653
性别 男
状态 离线
@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 ]
论坛跳转: