Dim strContents,lines,win,mac,unx
'delimiters for the various platforms
win=chr(13) & chr(10)
mac=chr(13)
unx=chr(10)
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(strFilePath, ForReading)
strContents = objFile.ReadAll
lines=Split(strContents,win)
If UBound(lines)=0 Then
lines=Split(strContents,unx)
If UBound(r)=0 Then
lines=Split(strContents,mac)
End If
End If
objFile.Close
For i=0 TO UBound(lines)
'lines(i) will hold the line content
'do whatever with it...
Next
|