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-12 19:27
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Seeking help on the use of the tokens parameter in the for command? View 4,957 Replies 29
Floor 16 Posted 2007-03-14 00:05 ·  中国 广西 柳州 电信
初级用户
Credits 83
Posts 39
Joined 2006-12-22 09:55
19-year member
UID 74267
Gender Male
Status Offline
I used to be half-understanding, but after watching the detailed explanation, I fully understood~~
Floor 17 Posted 2007-03-25 07:36 ·  中国 河南 洛阳 电信
初级用户
Credits 34
Posts 15
Joined 2007-03-25 06:54
19-year member
UID 82851
Gender Male
Status Offline
Floor 18 Posted 2007-03-30 00:31 ·  中国 河南 郑州 联通
初级用户
Credits 91
Posts 45
Joined 2007-03-14 07:04
19-year member
UID 81689
Gender Male
Status Offline
Originally, I also didn't understand what the * sign for tokens meant. I thought eol only removed the character that followed it. After listening to the explanation from user 6, I now understand. Hey, thanks!
Floor 19 Posted 2007-12-03 10:58 ·  中国 江苏 苏州 移动
银牌会员
★★★
Credits 1,608
Posts 780
Joined 2007-10-07 10:19
18-year member
UID 99089
Gender Male
Status Offline
I only feel it's right after I understand the document by myself and then look at this one
Floor 20 Posted 2008-01-11 20:32 ·  中国 福建 泉州 电信
新手上路
Credits 12
Posts 6
Joined 2008-01-11 19:20
18-year member
UID 108333
Gender Male
Status Offline
It's really an "aha" moment, a sudden enlightenment~~~~~~~

Really thanks to the guidance of the expert~~~~~~~
Floor 21 Posted 2008-01-14 17:32 ·  中国 广东 汕头 潮阳区 电信
高级用户
★★★
DOS时空
Credits 713
Posts 348
Joined 2007-02-10 13:59
19-year member
UID 79169
Gender Male
Status Offline
Good tutorial!!!!!!!!!!!!!
Floor 22 Posted 2008-01-18 20:04 ·  中国 山东 联通
初级用户
Credits 63
Posts 26
Joined 2007-12-14 17:58
18-year member
UID 105668
Gender Male
Status Offline
I want to know there is a %j in it, and I can't find where this parameter is
Floor 23 Posted 2008-01-18 20:05 ·  中国 山东 联通
初级用户
Credits 63
Posts 26
Joined 2007-12-14 17:58
18-year member
UID 105668
Gender Male
Status Offline
My Q is 284292673, email is: wangjmh@126.com
Thanks
Floor 24 Posted 2008-01-19 19:35 ·  中国 广东 汕头 潮阳区 电信
高级用户
★★★
DOS时空
Credits 713
Posts 348
Joined 2007-02-10 13:59
19-year member
UID 79169
Gender Male
Status Offline
I'll top this good post first, otherwise it'll be submerged again
Floor 25 Posted 2008-03-03 23:48 ·  中国 重庆 电信
初级用户
Credits 34
Posts 14
Joined 2007-12-13 18:21
18-year member
UID 105563
Gender Male
Status Offline
Not bad. I used to get confused when seeing piles of asterisk-number, number and other things. The explanation on the 6th floor is good. Add points.
Floor 26 Posted 2009-11-11 12:01 ·  中国 湖北 武汉 电信
新手上路
Credits 4
Posts 5
Joined 2009-10-19 21:13
16-year member
UID 153351
Gender Male
From 湖北省襄樊市南漳县
Status Offline
for can take values of more than 26 variables, and it is taken according to the order of ASCII size, up to 31.
When starting from A, it can reach 31, which are "A to Z, [, \, ], ^, _"
When starting from a, it can reach 29, which are "a to z, {, |, }"
When starting from!, it can reach 31, which are "!, ", #, $, &, ', (, ), *, +,,, -,., /, 0 to 9, :, ;, <, =, >,?"
Floor 27 Posted 2009-11-11 21:51 ·  中国 北京 联通
新手上路
Credits 1
Posts 1
Joined 2009-08-01 11:52
17-year member
UID 149714
Gender Male
From 北京
Status Offline
I've taken a look, and what's said on the 6th floor is very clear. Not bad!
Floor 28 Posted 2009-11-11 22:59 ·  中国 江苏 苏州 电信
初级用户
★★
Credits 133
Posts 75
Joined 2008-08-03 01:08
18-year member
UID 122677
Gender Male
Status Offline
for /f "tokens=2,* delims= " %%i in (a.txt) do echo %%i %%j for /f "tokens=2* delims= " %%i in (a.txt) do echo %%i %%j
Is there a difference between 2,* and 2*?
Floor 29 Posted 2009-11-12 00:23 ·  中国 四川 成都 电信
初级用户
★★
Credits 118
Posts 66
Joined 2006-08-18 16:04
19-year member
UID 60797
Gender Male
Status Offline
Study hard
Make progress every day
What the 6th floor said is good!
Floor 30 Posted 2009-11-12 13:19 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 245
Posts 103
Joined 2006-06-30 00:00
20-year member
UID 57801
Gender Male
Status Offline
Originally posted by slw218856 at 2009-11-11 22:59:
for /f "tokens=2,* delims= " %%i in (a.txt) do echo %%i %%j for /f "tokens=2* delims= " %%i in (a.txt) do echo %%i %%j
Is there a difference between 2,* and 2*?


Of course there is a difference. The help built into CMD explains it clearly.
Forum Jump: