Re: Import CSV



Nico

Use Split( sLine, "," ) to give you an array of the values.

e.g.

aLine = Split( sLine, "," )

then to redisplay with, say, space between the items

WScript.Echo Join( aLine, " " )

As for saving the values line by line for storage, try this:

Dim OPID, LastName, FirstName, CallDate, LogonTime, LogoffTime,
WorkHours
Dim aVars
aVars = Array( "OPID", "LastName", "FirstName", "CallDate",
"LogonTime", "LogoffTime", "WorkHours" )

then in the body of your do while not eof (or whatever)

aLine = Split( sLine, "," )
For i = 0 To UBound( aLine )
Execute aVars( i ) & " = " & Chr( 34 ) & aLine( i ) & Chr( 34 )
Next

The Execute then evaluates the code, being created here on the fly, to
set the variable whose name is at position i in aVars to be the value
of the item at position i in the record read from the file.

Hope that helps some. I use this technique a lot.

Regards,
Bruce.
<codeaholic.blogspot.com>

.