中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-07 10:16
48,040 topics / 350,125 posts / today 0 new / 48,252 members
DOS批处理 & 脚本技术(批处理室) » The `for` command is a relatively complex command
Printable Version  5,337 / 22
Floor16 wwwchn Posted 2008-01-10 12:18
新手上路 Posts 6 Credits 12
Learning
Floor17 satanism Posted 2008-01-11 12:10
新手上路 Posts 2 Credits 4
Headache. Still, go and read the article recommended on floor 8 first
Floor18 kgdetg1127 Posted 2008-01-25 23:06
初级用户 Posts 89 Credits 158
Dizzy. First, top it up.
Floor19 windowsxphao Posted 2008-02-21 11:36
初级用户 Posts 14 Credits 25
It's really useful for newbies like us, I'm upvoting
Floor20 hhjsir Posted 2008-02-21 15:54
新手上路 Posts 5 Credits 7 From beijing
Good
Floor21 ccc812 Posted 2008-02-24 00:37
新手上路 Posts 1 Credits 2
The building-block mentioned that "In addition, the replacement of FOR variable references has been enhanced. You can now use the following option syntax:

~I - Remove any quotes (") and expand %I

%~fI - Expand %I to a fully qualified pathname

%~dI - Expand %I to just a drive letter

%~pI - Expand %I to just a path

%~nI - Expand %I to just a file name

%~xI - Expand %I to just a file extension

%~sI - The expanded path contains only short names

%~aI - Expand %I to the file attributes of the file

%~tI - Expand %I to the date/time of the file

%~zI - Expand %I to the size of the file

%~$PATH:I - Find the directories listed in the path environment variable and expand %I to the first fully qualified name found. If the environment variable is not defined or the file is not found, this combination expands to an empty string. Modifiers can be combined to get multiple results:

%~dpI - Expand %I to just a drive letter and path

%~nxI - Expand %I to just a file name and extension

%~fsI - Expand %I to a full pathname with short names

%~dp$PATH:i - Find the directories listed in the path environment variable and expand %I to the first drive letter and path found.

%~ftzaI - Expand %I to a DIR.....like output line"

How are things like "%~fI" applied specifically? Can you give a simple example to illustrate? Also, I don't quite understand this sentence: "FOR /F "eol=; tokens=2,3* delims=, " %i in (myfile.txt) do command will analyze each line in myfile.txt, ignore those lines starting with a semicolon, pass the second and third tokens of each line to the for program body; delimited by commas and/or spaces." Among them, which parameter "ignores" "ignore those lines starting with a semicolon"? What are the functions of "eol=;" and delims=,?
Please the building-block or各位 experts explain~~~
Floor22 jipinshangren Posted 2008-04-11 11:12
初级用户 Posts 62 Credits 120 From 四川内江
Well, let's just give it a try. I think it should be easier to understand, hehe! Thanks, forum moderator!
Floor23 nacydu2008 Posted 2008-12-19 11:11
新手上路 Posts 2 Credits 0
There are still many places I don't understand, I'll digest it slowly
Prev  1 2
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023