Skip to content

Missing 'Id' CSV column in CSV file #307

Open
@mathishuettl

Description

@mathishuettl

Hello,

I'm brad new to this lib, but I'm getting the following error:

ChoETL.ChoMissingCSVColumnException: "Missing 'Id' CSV column in CSV file."

This is how my test.txt looks like:

"Id","Name"
"1","Tom"
"2","Carl"
"3","Mark"

My Poco

public partial class Account
{
    public string Id { get; set; }
    public string Name { get; set; }
}
foreach (var rec in new ChoCSVReader<Account>(rootDir + @"\test.txt").WithFirstLineHeader().QuoteAllFields())
{
    Debug.WriteLine("name:" + rec.Name);
}

And also the Console doesn't show up the Name

Questions:

  • My input files comes in that format (with quotes and comma) - how can I make this work?
  • What if my input file doesn't have an ID, instead the column is called AccountID or something like this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions