China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-07 00:40
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Please enter the specific content of the batch script related to deleting lines that you need to translate. Just providing "求一个删除行的批处理" alone doesn't have the specific content to translate. Please provide the actual batch script content that needs to be translated. View 2,992 Replies 13
Original Poster Posted 2006-10-18 05:13 ·  新加坡
中级用户
★★
Credits 249
Posts 64
Joined 2005-06-03 00:00
21-year member
UID 39315
Gender Male
Status Offline
There is an A.TXT file. When finding JKLJHLL in it, delete the lines containing the string JKLJHLL (case-insensitive).
Floor 2 Posted 2006-10-18 05:21 ·  中国 湖南 娄底 新化县 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
20-year member
UID 58987
From 湖南.娄底
Status Offline

@echo off
for /f "delims=" %%i in ('findstr /i /v /c:JKLJHLL a.txt') do (
echo %%i>>temp.txt
)
start temp.txt

I wonder if this is the effect the poster requested...
Floor 3 Posted 2006-10-18 07:48 ·  中国 上海 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline
  Give it a thumbs up~~

  findstr /v is clever~~
Floor 4 Posted 2006-10-18 08:16 ·  新加坡
中级用户
★★
Credits 249
Posts 64
Joined 2005-06-03 00:00
21-year member
UID 39315
Gender Male
Status Offline
Originally posted by pengfei at 2006-10-18 05:21 AM:

@echo off
for /f "delims=" %%i in ('findstr /i /v / JKLJHLL a.txt') do (
echo %%i>>temp.txt
)
start temp.txt

I wonder if this is the effect the poster requested...

Thank you!
Floor 5 Posted 2006-10-18 11:07 ·  中国 湖北 荆门 电信
初级用户
★★
Credits 186
Posts 117
Joined 2006-08-14 14:50
19-year member
UID 60491
Status Offline
findstr /ivc:"JKLJHLL" a.txt >b.txt
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
redtek +6 2006-10-18 22:52
Floor 6 Posted 2006-10-18 11:25 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
20-year member
UID 59080
Status Offline

This is even stronger, I support it!!!
Floor 7 Posted 2006-10-18 22:48 ·  中国 湖南 娄底 电信
银牌会员
★★★
Credits 1,218
Posts 485
Joined 2006-07-21 21:24
20-year member
UID 58987
From 湖南.娄底
Status Offline
Originally posted by mountvol at 2006-10-12:07:
findstr /ivc:"JKLJHLL" a.txt >b.txt


OK, you can completely do without FOR here.
Floor 8 Posted 2006-10-18 22:52 ·  中国 北京 东城区 联通
金牌会员
★★★★
Credits 2,902
Posts 1,147
Joined 2006-09-21 12:00
19-year member
UID 63324
Gender Male
Status Offline
Originally posted by mountvol at 2006-10-18 11:07:
findstr /ivc:"JKLJHLL" a.txt >b.txt


Top~Gave you 6 points~: )
    Redtek,一个永远在网上流浪的人……

_.,-*~'`^`'~*-,.__.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._,_.,-*~'`^`'~*-,._
Floor 9 Posted 2007-12-12 15:34 ·  中国 上海 浦东新区 电信
初级用户
★★
Credits 196
Posts 82
Joined 2005-09-26 11:31
20-year member
UID 42842
Status Offline
Searching "delete lines" only found this one post.
The problem I need to handle is a bit extreme. I need to compare the lines that are in file A but not in file B.
There are two TXT files, with more than 5000 lines (named A) and more than 2000 lines (named B) respectively.
If I use the above > method, wouldn't it be necessary to generate thousands of files?
And it doesn't seem to be efficient. Does anyone know if there is a better idea using P to handle it?
Floor 10 Posted 2007-12-16 22:15 ·  中国 四川 泸州 联通
高级用户
★★★
Credits 609
Posts 374
Joined 2006-08-02 22:38
20-year member
UID 59720
Status Offline
Originally posted by pillow at 2007-12-12 15:34:
Searching "delete line" only finds this one post,
The problem I need to handle is a bit extreme. I need to compare the lines that are in file A but not in file B.
There are two TXT files, with more than 5000 lines (named A) and 20 ...


Use B + A ------ Use delete duplicate lines ------ Find the number of marked lines between B and A ------ Use more +n to extract
Floor 11 Posted 2008-02-27 20:45 ·  中国 河北 石家庄 联通
中级用户
Credits 205
Posts 32
Joined 2004-02-06 00:00
22-year member
UID 16828
Gender Female
Status Offline
I haven't used this command yet, and I don't know how to!
Floor 12 Posted 2008-03-05 10:33 ·  中国 江苏 南京 电信
新手上路
Credits 8
Posts 3
Joined 2007-05-29 20:58
19-year member
UID 89697
Gender Male
Status Offline
After using it in my example, the error "FINDSTR: The search string is too long" is reported. What should I do?
Floor 13 Posted 2008-06-02 03:22 ·  中国 陕西 西安 电信
初级用户
Credits 54
Posts 26
Joined 2007-02-10 12:34
19-year member
UID 79167
Gender Male
Status Offline
Finding Chinese characters is really slow
Floor 14 Posted 2008-06-02 14:02 ·  中国 广东 广州 电信
初级用户
Credits 48
Posts 27
Joined 2008-06-01 23:43
18-year member
UID 120310
Gender Male
Status Offline
It's professional enough, I can't understand.
Forum Jump: