VBS的新功能。我正在尝试计算文件中的字段并获取此代码。
Col()
Function Col()
Const FSpec = "C:\test.txt"
Const del = ","
dim fs : Set fs = CreateObject("Scripting.FileSystemObject")
dim f : Set f = fs.OpenTextFile(FSpec,1)
Dim L,C
Do Until f.AtEndOfStream
L = f.ReadLine()
C = UBound(Split(L,del))
C = C +1
WScript.Echo "Items:",C
Loop
f.Close
End Function
但是它有效,我不想在“”中计算出delim。
这里的文件内容:
1,“ 2,999”,3
所以基本上,我现在要买4件,但我想买3件。