Please observe this flat file image: http://screencast.com/t/YMpeI5pOlI
You will on the bottom of the text file, line numbers shown by MSVS 2005 that tell me that a line exists, yet with no TEXT along side it, the text file has too many carriage returns at the bottom. Lets call these BLANK ROWS of data in my text file.
The issue is when I import this data like (vbNET):
Dim oRead As StreamReader
Dim str As String
Dim rows(0) As String
oRead = New StreamReader(FullPath)
str = oRead.ReadToEnd()
str = str.Replace(vbCr, "")
rows = str.Split(ControlChars.Lf)
The rows array has entries within it for the BLANK lines I show in the image attached. And this mucks up my indexes when I manipulate that rows data.
Can I do a 'Replace' or something to clear these BLANK lines before they get into my rows array ??
At the moment I just clean up the text file before import, but I need a coding solution to make my life easier !
Any ideas ! What do you do ?
View Complete Post