What does this SQL parsing code actually do?

Soldato
Joined
20 Jun 2004
Posts
5,922
Location
Essex
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objCSVFile = objFSO.OpenTextFile("sample.csv",1)
Set objResultFile = objFSO.CreateTextFile("results.txt",true)

Do while NOT objCSVFile.AtEndOfStream
arrStr = split(objCSVFile.ReadLine,",")
If arrStr(0) <> "" And arrStr(0) <> "string not to include" Then
strResults = strResults & arrStr(0) & "+"
End If
Loop
objResultFile.Write strResults
objCSVFile.Close
objResultFile.Close


Thanks! Oops - typed SQL rather randomly! VB even.
 
Puts the first column from the sample.csv, unless it's empty or contains 'string not to include' in the results.txt file. And it puts it all on one line with the + as the delimiter.

Or I reckon anyway....
 
Back
Top Bottom