Eccolo:
codice:
<%
Dim conn, fs, objFile, objFileTextStream, i, strSQL, file
Dim strLine, strLinePart, strValore1, strValore2, strValore3, strValore4, strValore5, strValore6, strValore7
Set fs = Server.CreateObject("Scripting.FileSystemObject")
file = server.mapPath("/public/testo.txt")
Set objFile = fs.GetFile(file)
Set objFileTextStream = objFile.OpenAsTextStream(1)
Do While objFileTextStream.AtEndOfStream <> True
strLine = objFileTextStream.ReadLine
strLinePart = split(strLine,"|")
for i = 0 TO UBound(strLinePart)
If i = 0 Then
strValore1 = Trim(strLinePart(i))
ElseIf i = 1 Then
strValore2 = Trim(strLinePart(i))
ElseIf i = 2 Then
strValore3 = Trim(strLinePart(i))
ElseIf i = 3 Then
strValore4 = Trim(strLinePart(i))
ElseIF i = 4 Then
strValore5 = Trim(strLinePart(i))
ElseIF i = 5 then
strValore6 = Trim(strLinePart(i))
ElseIF i = 6 then
strValore7 = Trim(strLinePart(i))
End If
Next
strSQL = "INSERT INTO tabella (Valore1, Valore2, Valore3, Valore3, Valore4, Valore5, Valore6, Valore7) Values('"&strValore1&"', '"&strValore2&"', '"&strValore3&"', '"&strValore4&"','"&strValore5&"','"&strValore6&"','"&strValore7&"'"
conn.Execute strSQL
Loop
objFileTextStream.Close
Set objFileTextStream = Nothing
Set fs = Nothing
%>
Grazie