Good day to all,
i have a problem regarding CSV parse using File Helper. My CSV is look like this
,,,026642,0,00336,05,19,"WATERMELON *",19,"1 ",,,,,,,,0,,001.99.,0,,,,,0,,0,0,,,,,,,,,,,,,,,,,,51,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,026645,0,00338,05,19,"ONION ",19,"*1 ",,,,,,,,0,,002.99.,0,,,,,0,,0,0,,,,,,,,,,,,,,,,,,51,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ,,,026687,0,00380,05,19,"MUSHROOM ",19," (BLACK FUNGUS) ",,,,,,,,0,,021.90.,0,,,,,0,,0,0,,,,,,,,,,,,,,,,,,51,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
which this CSV have 116 column / field.
The problem was i just need only 4 field from whole line which
Field 4 = 026687, Field 9 = "WATERMELON *", Field 11 = "(BLACK FUNGUS)", Field 21 = 002.99.
When i using wizard which a very good solution to make instance class, and i put FieldValueDiscarded _ on top of every other fields i don't need it, it just print a same as CSV input.
Please give me some advise how do i extract only needed field to write into output.
Thank you
UPDATED : After research some more, i finally getting clear about this error. This error happen because class non-inherited so i cannot get specific field into another class. By declare mapping class as inherited class, i can get specific field.
However, i stuck at how to retrieve functions inside the class who inherited from mapping class. This is my code `Imports System.Text Imports System.IO Imports FileHelpers
Public Class ProcessField : Inherits InputCSV
Public Function MyPLUc(ByVal value As Integer)
Dim PLUc As String
MyBase.PLU = value
PLUc = (0 + 0 + value)
Return (0 + 0 + value)
End Function
Public Function MyStatusc(ByVal value As Integer)
MyBase.Status = value
Dim Status As Integer
If value > 0 Then
Status = 800
Else
Status = 900
End If
Return (0 + Status)
End Function
Public Function MyUnitPricec(ByVal value As Integer)
MyBase.UnitPrice = value
Dim UP As Integer
UP = value
Dim bytes As Byte() = System.Text.Encoding.Unicode.GetBytes(UP)
Return (0 + 0 + 0 + UP)
End Function
Public Function MyLabelFormat(ByVal value As Integer)
Return (1 + 1)
End Function
Public Function MyEAN(ByVal value As Integer)
Return (0 + 6)
End Function
Public Function MyCName(ByVal value As String)
MyBase.CName1 = value
Dim hexString As String = Hex(value)
Return (hexString)
End Function
Public Function MyBCC(ByVal value As String)
value = (0 + 0)
Return (0 + 0)
End Function
End Class`
and the problem is how i retrieve all return value in these function