Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:22:20+00:00 2026-06-13T06:22:20+00:00

Good day to all, i have a problem regarding CSV parse using File Helper.

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:22:21+00:00Added an answer on June 13, 2026 at 6:22 am

    I’m not sure I understand your question, but I think you are making things more complicated than you need.

    You can just create your FileHelpers class with 116 string fields. They should be (public) fields, NOT properties. You should NOT subclass the FileHelpers class. Do not try to use the FileHelpers class as a normal class (i.e., with properties, functions, etc, subclasses). Think of the FileHelpers class as a ‘specification’ of your CSV format only.

    To import, you write something like:

    Dim engine As New FileHelperEngine(GetType(RecordSpec)) 
    
    ' To Read Use: 
    Dim results As RecordSpec() = DirectCast(engine.ReadFile("FileIn.txt"), RecordSpec()) 
    

    Then you have an array of RecordSpec. Each RecordSpec will have all 116 fields populated, but just ignore the fields you don’t need. Then loop through the results and do whatever you want with the values. For instance, perhaps you need to map the imported fields to another (more normal) MyProduct class with properties instead of fields and perhaps with additional logic.

    For Each recordSpec As RecordSpec In results
      Dim myProduct = New MyProduct()
      myProduct.Id = recordSpec.Field4
      myProduct.Name = recordSpec.Field9
      myProduct.Category = recordSpec.Field23
      ' etc.
    Next
    

    In summary: the RecordSpec class should only be used to define the structure of the CSV file. You use it to populate a simple array with all the values from the file. You then map the values to a more useful class MyProduct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good day to all, I have the following problem I have to convert the
Good day everyone. I have been having the same problem all day at work
Good day to all. I have the flowing problem. I have 2 domains. On
Good day to all. I have a little problem. Can anyone tell me or
Good day all, I have an html file as follows, which displays a Google
Good day, I have a problem in a .NET page where I am using
Good day to all. I have a problem with the following code: textBox.addEventListener(KeyboardEvent.KEY_DOWN,handler); function
Good day all, first of all, what am trying to do is have an
Good day, all. I know that this is a pretty basic question in terms
Good day, Stack Overflow. I have a homework assignment that I'm working on this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.