Board logo

标题: 逐行读取中如何不显示每行前五位 [打印本页]

作者: yywd     时间: 2008-6-7 22:02    标题: 逐行读取中如何不显示每行前五位

逐行读取中如何不显示每行前五位

下面只能逐行读取显示每行全部

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\1\1.txt", 1)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
Wscript.Echo strLine
Loop
objFile.Close

[ Last edited by yywd on 2008-6-7 at 10:05 PM ]
作者: bat-zw     时间: 2008-6-7 22:37    标题: 不懂vbs:

我觉得这个用批处理就能很好地解决:
@echo off&setlocal enabledelayedexpansion
for /f "delims=" %%i in (a.txt) do (
     set str=%%i
     echo !str:~5!
     ping /n 2 127.1>nul
)

作者: slore     时间: 2008-6-7 22:49
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("d:\1\1.txt", 1)
Do Until objFile.AtEndOfStream
    strLine = objFile.ReadLine
   
Wscript.Echo Mid(strLine,6)
Loop
objFile.Close
作者: yywd     时间: 2008-6-7 23:11
谢谢您, 很好用
作者: joyn     时间: 2008-6-7 23:14
如 Slore 所写
作者: terse     时间: 2008-6-8 01:15
加上 objFile.Skip(5) 也一样
作者: bat-zw     时间: 2008-6-8 20:26
难道用批处理不行吗?非要用vbs?