【发布时间】:2021-03-29 00:26:05
【问题描述】:
我有一个只有一行的文本文件。我需要提取由字符分隔的行的每个部分。示例:
1212123123!asdf asdf asdf asdf u!herd!TOTO!
我需要能够在没有! 的情况下回显! 之间的每个部分并显示它们
A:1212123123
B:asdf asdf asdf asdf u
C:herd
D:TOTO
我没有在知识库中找到解决方案
我试过了:
Set "String=1212123123!asdf asdf asdf asdf u!herd!TOTO!"
for /f "delims=2" %%f in (%String%) do set "%%f" (
Set "Up2Sub=%String:*!=%"
Set "SubStr=%Up2Sub:!="&:"%"
echo %SubStr%
)
但我得到了结果:
The system cannot find the file 1212123123!asdf.
asdf asdf asdf asdf u
感谢您的帮助
【问题讨论】:
标签: string batch-file character