小编Pus*_*ngh的帖子

如何使用vbscript从文本文件中读取每20行?

我在文本文件中有180行,并且想要每20行读取一次(1-20,21-40 ......)

这是我目前的代码:

Const ForReading = 1

Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objTextFile = objFSO.OpenTextFile("C:\Bess_Automation\EditFiles\TSTVLD1.txt", ForReading)

'Reading the count of lines
objTextFile.ReadAll
strLinecount=objTextFile.Line
msgbox strLinecount

strnumoftimes=Round((strLinecount/20),0)
msgbox strnumoftimes
Run Code Online (Sandbox Code Playgroud)

vbscript

5
推荐指数
1
解决办法
730
查看次数

标签 统计

vbscript ×1