『楼 主』:
for的使用问题
使用 LLM 解释/回答一下
有什么办法 可以用 for指令来分析 我dir c:\windows\system32\drivers\etc\hosts >>d:\1.txt 之后的 1.txt中 字节部分。
例子:
我首先用 dir c:\windows\system32\drivers\etc\hosts >>d:\1.txt生成了一个 1.txt。 该文本的内容如下。
-----------
驱动器 C 中的卷没有标签。
卷的序列号是 2C10-E32D
c:\windows\system32\drivers\etc 的目录
2003-03-03 23:23 730 hosts
1 个文件 730 字节
0 个目录 2,955,378,688 可用字节
---------------------
现在我需要用 for 指令来 读取 730 字节 中的 730 这个数值赋给一个变量, 但是 我用for,/f,"skip=6 tokens=1,2,*",%%a in (d:\1.txt) do @each %%a>d:\2.txt
好像有问题。 而且, 730字节后还有 2行, 怎么屏蔽后面的2行呀。。
我只想区 这个 730 数值, 然后去对比 是不是 等于 我想要的值。。 怎么做到?
Is there any way to use the for instruction to analyze the byte part in 1.txt after I use dir c:\windows\system32\drivers\etc\hosts >>d:\1.txt.
Example:
I first use dir c:\windows\system32\drivers\etc\hosts >>d:\1.txt to generate a 1.txt. The content of this text is as follows.
-----------
The volume in drive C has no label.
The serial number of the volume is 2C10-E32D
Directory of c:\windows\system32\drivers\etc
2003-03-03 23:23 730 hosts
1 file 730 bytes
0 directories 2,955,378,688 available bytes
---------------------
Now I need to use the for instruction to read the value 730 in 730 bytes and assign the value 730 to a variable. But I use for,/f,"skip=6 tokens=1,2,*",%%a in (d:\1.txt) do @each %%a>d:\2.txt
There seems to be a problem. And there are 2 lines after 730 bytes, how to shield the following 2 lines..
I just want to get the value 730, and then compare whether it is equal to the value I want.. How to do it?
|