926 questions
-1
votes
0
answers
52
views
CsvHelper - read multiple rows to a single list grouped by a column on CSV [closed]
"Cust1", "CustomerFirstName","CustomerLastName","Street1", "City1","OrderId1","OrderName1"
"Cust1", "...
0
votes
1
answer
27
views
CSVHelper Map available fields
Is there a way to map available fields coming from a CSV file ignoring fields that may not be present in the CSV? For example, I have a class with 5 properties. I want to allow mapping from CSV for ...
0
votes
1
answer
109
views
Character encoding issues while uploading / downloading a CSV to Azure Blob Storage using C#
I have a service which allows users to upload and download a CSV file to update data in a system using C#. This data contains foreign characters. The file appears to upload fine. If I download and ...
0
votes
2
answers
83
views
How to map a nested class by CsvHelper?
class A
{
public C MyC;
public int OtherStuff;
}
class B
{
public C MyC1;
public C MyC2;
}
class C
{
public int WeirdInt;
public string WeirdString;
}
I want to create a ...
1
vote
2
answers
86
views
Write CSV from Nested anonymous object
I didn't succeed to write a CSV for the following structure, I'm pretty sure it should be possible automatically but I'm missing something...
The _recordedData variable is a dictionary of List<...
0
votes
1
answer
92
views
Ignore Comma Delimiter in CsvHelper
I've a project that uses CsvHelper package to parse excel file. Unfortunately I came into a condition where I've to ignore comma as delimiter that CsvHelper does by default I believe. The data in a ...
1
vote
2
answers
108
views
Reading a CSV, modify some field values, writing it back using CsvHelper
I'm using CsvHelper v33.0.1 in a C# program. I'm taking an existing CSV file that contains 70+ columns and about 3000 rows, modifying 3 column values, then rewriting the modified rows back to the ...
-2
votes
2
answers
65
views
What does Format("0.0".PadRight(100, '#') do when writing a CSV with CSVHelper
I have a piece of code I am currently refactoring, but I can't find documentation about what a line in one of the ClassMaps is doing exactly. I try to get rid of the ClassMaps and replace them with ...
1
vote
1
answer
67
views
With CsvHelper, how do I make it use string.Empty instead of Null for missing varchar fields?
Say I have a c# class "Person" with a property named "FirstName". In the database, FirstName is a VARCHAR(100) NOT NULL field. When CsvHelper imports a CSV that lacks a FirstName ...
3
votes
1
answer
97
views
CsvHelper no longer has Context.IsFieldBad
I'm upgrading a program from CsvHelper v2.15.0 to v33.0.1 and dealing with all the changes. I've fixed most of them, but I can't find the solution to this. In my old code I have:
while (csv.Read() &...
0
votes
0
answers
61
views
CsvHelper breaking changes - CsvSerializer
I am upgrading CsvHelper from a very old version (v15). I have this code:
using (var csv = new CsvWriter(new CsvSerializer(output, CultureInfo.CurrentCulture)))
csv.WriteRecords(report);
...
1
vote
1
answer
68
views
CsvHelper passing parameter into map constructor when registering class map
I am using CsvHelper to read a csv file and create a list of records from a file.
I have different types of csv files that contain data to be mapped to the same properties of my models but the headers ...
0
votes
2
answers
92
views
Need help parsing HTML markup with CSVHelper through my .NET API
I receive a CSV from an third party in this format:
Job Requisition Id,Brand,Is Deleted,Internal Status,Job Code,Job Title-JobRequisitionLocale,Posting Start Date-JobRequisitionPosting,Posting End ...
1
vote
1
answer
102
views
CSV Helper - Create Numeric column instead of General
I am using CSV Helper to create a CSV file as follows:
for (int i = 0; i < dsData.Rows.Count; i++)
{
DateTime invDate = Convert.ToDateTime(dsData.Rows[i]["DocDate"].ToString());
...
-1
votes
1
answer
77
views
Write RTL to CSV file using C#
I am trying to write a function that receives a DataTable and writes the data from it into a csv file, The function works, but I want the file content to be displayed in Right-to-Left (RTL)..
I tried ...