|
amio
中级用户
积分 206
发帖 93
注册 2007-8-16
状态 离线
|
『楼 主』:
删除文件内容问题
aaa,"aaal\aaa\aaa","%aaa%",aaaaa,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
bbb,"bbbl\bbb\bbb","%bbb%",bbbbb,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,\
只想删除
bbb,"bbbl\bbb\bbb","%bbb%",bbbbb,\
下面的 00,00......00,\ 一行 ?
|
|
2008-5-31 09:37 |
|
|
WANKOILZ
初级用户
积分 198
发帖 89
注册 2007-9-6 来自 重庆
状态 离线
|
『第
2 楼』:
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%i in ('findstr/n .* 1.txt') do (
set "str=%%i"
set "str=!str:*:=!"
if not defined flag (echo.!str!>>2.txt
) else (set flag=)
if "!str:~0,3!"=="bbb" set flag=ok
) [ Last edited by WANKOILZ on 2008-5-31 at 11:51 AM ]
|
|
2008-5-31 11:49 |
|
|
amio
中级用户
积分 206
发帖 93
注册 2007-8-16
状态 离线
|
『第
3 楼』:
Quote: | Originally posted by WANKOILZ at 2008-5-31 11:49 AM:
[code]@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%i in ('findstr/n .* 1.txt') do (
set "str=%%i"
set "str=!str:*:=!"
if not defined flag ... |
|
这个不行 , 如果在再下面加一行
bbb,"bbbl\bbb\bbb","%bbb%",bbbbb,\
00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,00,01,00,00,\
把0 随便换个1 都会被删除
|
|
2008-5-31 13:00 |
|
|
WANKOILZ
初级用户
积分 198
发帖 89
注册 2007-9-6 来自 重庆
状态 离线
|
『第
4 楼』:
我的是凡是 bbb 的下一行就删除。
要删除的都在bbb下面,且以0开头?你要一次说清楚点..........
[ Last edited by WANKOILZ on 2008-5-31 at 02:00 PM ]
|
|
2008-5-31 13:58 |
|
|
amio
中级用户
积分 206
发帖 93
注册 2007-8-16
状态 离线
|
『第
5 楼』:
可不可以把 bbb 换成 bbb,"bbbl\bbb\bbb","%bbb%",bbbbb,\
|
|
2008-5-31 14:20 |
|
|