I tried this code :
FileName = "C:\temp\SC.csv"
Open FileName For Input as #1
Do Until EOF #1
Input #1, datastring
Loop
Close #1
and I get this message :
Windows Script Host
Error: Expected end of statement
Code: 800A0401
Source: Microsoft VBScript compilation error
I can't find out where I made a mistake...
Can anyone help me ?
Thanks
You're use QBasic not VBScript syntax.
You need to use the FileSystemObject.
Option Explicit
Const cOTF = "C:\temp\SC.csv"
Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")
Dim objOTF
Set objOTF = objFSO.OpenTextFile(cOTF,1)
If Not objOTF.AtEndOfStream Then
WScript.Echo objOTF.ReadLine()
End If
Set objOTF = Nothing
Set objFSO = Nothing
This just displays each line in the file.
Run under WScript it will "popup" each record.
Run under CScript it will list each record in a window.