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-06-24 02:12
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » In the for statement, if you want to handle several lines in the middle, how to write the skip? View 2,611 Replies 20
Floor 16 Posted 2007-09-17 19:27 ·  中国 福建 厦门 电信
初级用户
Credits 39
Posts 15
Joined 2007-09-16 09:11
18-year member
UID 97510
Gender Male
From 福建
Status Offline
The post on the 4th floor, although it didn't mention the dir command, but the output result of the dir command is also a kind of situation of the problem on the 1st floor, because the first and last few lines need to be thrown away as well. We should consider the problem as comprehensively as possible... You say, right?
Floor 17 Posted 2007-09-17 19:45 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
Yeah, what you said makes so much sense!
Floor 18 Posted 2007-09-17 20:10 ·  中国 福建 厦门 电信
初级用户
Credits 39
Posts 15
Joined 2007-09-16 09:11
18-year member
UID 97510
Gender Male
From 福建
Status Offline
Moderator, don't be angry. Little brother is new here and finds the place very popular, so just wants to express personal thoughts. If it's incorrect, please consider I didn't say it. Not intentionally offending you... Please bear with me a lot.

[ Last edited by renrenrenshk on 2007-9-17 at 08:12 PM ]
Floor 19 Posted 2007-09-17 20:12 ·  中国 湖北 武汉 电信
版主
★★★★★
Credits 11,386
Posts 4,938
Joined 2006-07-23 17:10
19-year member
UID 59080
Status Offline
I didn't consider everything comprehensively, please forgive me, brother.
Floor 20 Posted 2007-09-18 01:32 ·  中国 江苏 常州 溧阳市 电信
银牌会员
★★★
Credits 2,404
Posts 946
Joined 2005-09-08 13:44
20-year member
UID 42345
Status Offline
RE:6692836 -2 points to me
Although the previous post has deficiencies
But when processing files starting with: it can not be filtered out:
Floor 21 Posted 2008-04-02 21:39 ·  中国 陕西 西安 电信
银牌会员
★★★★
钻石会员
Credits 2,278
Posts 1,020
Joined 2007-11-19 13:34
18-year member
UID 103127
Gender Male
Status Offline
Originally posted by wudixin96 at 2007-9-17 10:30 AM:
for /f "delims=" %%i in ('dir /a-d /-c^|findstr /r "*--"') do echo %%i

Only for the problem of floor 6

In fact, sed can solve the problem of the landlord very well

...


In fact, it's still troublesome. Since findstr is used, why use for?

dir/a-d/-c|findstr /b 2008
山外有山,人外有人;低调做人,努力做事。

进入网盘(各种工具)~~ 空间~~cmd学习
Forum Jump: