How do I read the whole row while using LumenWorks
CVS parser? So far am only able to read entry by entry but not the whole row. i.e. if a row is a,b,c,d,e,f
, am able to pluck out each individual alphabet. However, I want to be able to read the whole row
Currently I have:
my_csv = New CsvReader(New StreamReader(file_path), False, ",", resetPoint)
field_count = my_csv.FieldCount
While my_csv.ReadNextRecord()
'process the data here
'This code will process each individual alphabet in one row
The above reads each individual alphabet. What I want is to have something like
row = my_csv.row
Is this option available or something similar?
'EDITED'
When you have basic VB programming skills like me, this is what you come up with to solve the problem
Dim my_string As String = ""
For x As Integer = 0 To my_csv.FieldCount - 1
my_string += my_csv(x).ToString.Trim + ","
Next
my_string = Mid(my_string, 1, Len(my_string) - 1)
Return my_string
By all means use the code in the marked answer. Its super elegant!
I haven't found anything available, but this should work:
VB:
C#: