I have the following piece of code which works fine and does what it is intended for. But my source data has a line added to the very bottom and it makes this thing break. When I go and delete that last line, this code works fine. I dont want manually modify the file everyday this script runs. Following is the code. Is there any way I can ignore the last line of my input and process the rest of it. I know its a simple conditional if-else, but I dont have any clue about .net and someone else helped me write this code. Thanks in advance.
Public Overrides Sub Input0_ProcessInputRow(ByVal Row As Input0Buffer)
Dim strRow As String
Dim strColSeperator As String
Dim rowValues As String()
strRow = Row.Line.ToString()
If strRow.Contains(",") Then
strColSeperator = (",")
ElseIf strRow.Contains(";") Then
strColSeperator = ";"
End If
rowValues = Row.Line.Split(CChar(strColSeperator))
Row.Code = rowValues.GetValue(0).ToString()
Row.Description = rowValues.GetValue(1).ToString()
Row.Blank = rowValues.GetValue(2).ToString()
Row.Weight = rowValues.GetValue(3).ToString()
Row.Scan = rowValues.GetValue(4).ToString()
End Sub
Sample input data: 643492,PV STRIP 1X1 UTILITY UP,,56,393454 Last line of the input file: "EndDb"