Quantcast
Viewing all articles
Browse latest Browse all 15778

RC6.CSV ignores blank lines

When using RC6.CSV to read (parse) a text file, it seems that empty lines are ignored (not parsed). But in many cases, blank lines are very important for parsing algorithms. I'd like to know if there is a way to solve this problem. Thanks.

Code:

Option Explicit

Implements ICSVCallback

Private CSV As cCSV

Private Sub Form_Load()
    Dim sText As String
    Dim B() As Byte
   
    Set CSV = New_c.CSV
    CSV.ColSepChar = vbNullChar
    CSV.QuotChar = vbNullChar
   
    'sText = "AAAA" & vbCrLf & "BBBB" & vbCrLf & "CCCC" & vbCrLf & vbCrLf
    sText = "AAAA" & vbLf & "BBBB" & vbLf & "CCCC" & vbLf & vbLf
   
    B() = StrConv(sText, vbFromUnicode)
   
    CSV.ParseBytes B(), Me
   
End Sub

Private Function ICSVCallback_NewValue(ByVal RowNr As Long, ByVal ColNr As Long, B() As Byte, ByVal BValStartPos As Long, ByVal BValLen As Long) As Long
    Dim sRowText As String
   
    sRowText = CSV.GetStringValue(B, BValStartPos, BValLen)
    Debug.Print sRowText
   
End Function


Viewing all articles
Browse latest Browse all 15778

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>