中国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-11 15:06
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » How can I add custom delimiters to the delims parameter in the for command?
Printable Version  853 / 2
Floor1 faraway Posted 2009-03-06 04:26
新手上路 Posts 6 Credits 13
In the help for the for command, the explanation for delims is as follows:

delims=xxx - Specifies a delimiter set. This replaces the
default delimiter set of spaces and tabs.


If I need the default delimiter set, but also want to add other delimiters, how can I do that?

Actually, the above question can also be understood as: how do I input a “tab”!
Because as long as I can input a tab, I can keep the original delimiter set.
Floor2 netbenton Posted 2009-03-06 07:41
银牌会员 Posts 752 Credits 1,916 From 广西
Doesn't anyone know what the Tab key on the keyboard is for? Who knows?

for /f "delims=a" %%a in ('dir') do echo %%a

[ Last edited by netbenton on 2009-3-6 at 05:43 ]
Floor3 faraway Posted 2009-03-08 09:56
新手上路 Posts 6 Credits 13
Originally posted by netbenton at 2009-3-6 07:41:
Doesn't anyone know what the Tab key on the keyboard is for? Who knows?

for /f "delims=a" %%a in ('dir') do echo %%a

[ Last edited by netbenton on 2009-3-6 at 05:43 ]



In a batch file, brother, what you said is correct, but in DOS command-line mode, pressing the TAB key seems to have no response :(
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023