Comments (4)
Seems to work fine for me with defaults.
void Main()
{
var s =
"""
Header1,Header2,Header3,IntHeader,DecimalHeader,DateTimeHeader
content1,"content , (i have comma inside) 2","content3",100,100.00,"04/23/2024"
content2,"content ,,, (many comma inside)","content2",200,200.00,"05/01/2024"
""";
var config = new CsvConfiguration(CultureInfo.InvariantCulture)
{
};
using (var reader = new StringReader(s.ToString()))
using (var csv = new CsvReader(reader, config))
{
csv.GetRecords<Foo>().ToList().Dump();
}
}
public class Foo
{
public string Header1 { get; set; }
public string Header2 { get; set; }
public string Header3 { get; set; }
public int IntHeader { get; set; }
public decimal DecimalHeader { get; set; }
public DateTime DateTimeHeader { get; set; }
}
![image](https://private-user-images.githubusercontent.com/114971/325305359-84da5ad3-4eda-4cb9-bada-b30de453d0eb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTYxNTA2NTAsIm5iZiI6MTcxNjE1MDM1MCwicGF0aCI6Ii8xMTQ5NzEvMzI1MzA1MzU5LTg0ZGE1YWQzLTRlZGEtNGNiOS1iYWRhLWIzMGRlNDUzZDBlYi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNTE5JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDUxOVQyMDI1NTBaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wYzRlNDk5ZTY5ZWY1OTA0N2JjODY1MDQxNTk3NWQyMjQzNzliOTFiNDJiZjllOWE2MTA3NzMyN2FhZDRkMTIxJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.q6ui9MXBe_EWVTF6qBZ7vG5KIEtgEHVxGzIk7EyfqXo)
from csvhelper.
Sign..... really sad! it's not working in my environment.
FYI, my version is 31.0.3
from csvhelper.
I guess maybe the Unicode character inside the actual CSV file.
like below:
from csvhelper.
CsvHelper doesn't care about that. You set the encoding in your TextReader
. It'll use whatever delimiter you have set up in the config.
from csvhelper.
Related Issues (20)
- Microsoft.Bcl.AsyncInterfaces dependency error on System.Threading.Tasks.Extensions HOT 4
- ConfigurationException: 'Types that inherit IEnumerable cannot be auto mapped' when using custom class based on DynamicObject (NOT ExpandoObject) which also implements IDictionary HOT 3
- Missing "Product Version" in CsvHelper.dll HOT 1
- Column Name not displaying Using Mapping HOT 1
- Just thrown new exception by choice.
- Unexpected `InvalidCastException` in `TypeConverter<>` with nullable structs and value types HOT 2
- List<T>.ToAsyncEnumerable not accessible anymore after upgrade to CSVHelper 31.0.2 (.NET 8) HOT 5
- Set Custom Headers that derives from the property value. HOT 7
- Eliminate the columns if empty HOT 1
- Unregister ClassMap does not clear the previous maps if the same class is used HOT 2
- Getting problems with release build of my app using COM HOT 1
- add my report list columns' name as a header to the csv file when the HasHeaderRecord is set to false
- When Query from db and return IEnumable, will execute 2 times for sql query HOT 3
- Validate Header generate a very large message. HOT 2
- FastDynamicObject broke serialization HOT 7
- Using a ClassMap with custom type converter results in a "newed" object. HOT 1
- Using Custom TypeConverter causes dangerous/spurious CsvWriter behavior
- csv helper is writing 1 to 12 datetime in different format and 13 to 24 in different datetime format using version 4.0.30319 HOT 1
- FastDynamicObject ignores headers while used together with CsvWriter HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from csvhelper.