Re: reading a file that has null or blank field



RdS wrote:

sorry...but I see you answered inline. :) That helped a lot.

I cannot statically assigned an upper boundary because some records don't contain all fields. Would there be another way to do this to handle this situation?

do until objSourceFile.AtEndOfStream
arySourceFields = split(objSourceFile.ReadLine,",",-1,1)
Select Case UBound( arySourceFields )
Case 4 ' ok no need to do more
Case 1 ' just the first number (I hope, you must check!)
arySourceFields = Array( arySourceFields( 0 ), "world", 3, 4, 5 )
Case Else
skip or raise hell
e.g. WScript.Echo "Bad data in Line ..." : Exit Do
End Select
work with all fields
loop
.


Loading