如何识别txt文件中的字符串并将其设置为变量 [英] How to recognize string in txt file and set it as variable
问题描述
我有txt文件,其中的字符串以字符串开头:
数据目录.... :
如何(使用批处理文件)在文本中找到它,读取并将值设置为变量?我的意思是字符串是:
数据目录....:c:\datadir
我的意思是什么价值在这种情况下是"c:\ datatir"。所以我希望批处理文件读取txt文件,找到以"data directory ....:"开头的字符串。然后设置"c:\ datatir""作为变量。
Best,mac
< blockquote>
尝试研究这两个命令"
FOR /?
SET /?
Hi,
I have txt file and somwhere in it string starting with:
data directory....:
How (using batch file) find it in the text, read and set the value as a variable? I mean the string is:
data directory....: c:\datadir
where what I mean value is in this case "c:\datadir". So I want batch file to read the txt file, find string starting with "data directory....:" and then set "c:\datadir" as a variable.
Best, mac
Try studying these two commands"
FOR /?
SET /?
这篇关于如何识别txt文件中的字符串并将其设置为变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!