【发布时间】:2014-09-16 20:37:21
【问题描述】:
有谁知道在 DOS 批处理脚本中让多个字符成为“eol”字符的方法。我想同时使用';'和 '#' 作为字符来注释一行。
type t.txt
this is a line
#this is a commented line
;is this a commented line
last line
for /f "usebackq tokens=* eol=; eol=#" %f in (`type t.txt`) do (echo "%f")
"this is a line"
";is this a commented line"
"last line"
for /f "usebackq tokens=* eol=;#" %f in (`type t.txt`) do (echo "%f")
#" was unexpected at this time.
【问题讨论】:
标签: batch-file for-loop