-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing Delimiter Documentation #1653
Comments
Configuration is read only now. You can pass an instance into the constructor of the reader. The documentation examples are updated. https://joshclose.github.io/CsvHelper/getting-started |
The documentation doesn't really say, for example the following wont compile. Dim config = New CsvConfiguration(CultureInfo.InvariantCulture) With {.Delimiter = fieldDelim} results in the following errors 'Delimiter' has a return type that is not supported or parameter types that are not supported. |
you have to do it like this:
and yea, i agree. update the documentation before stuff breaks =) |
@madhon I'm looking into how C#'s |
@madhon I created a constructor that takes in every parameter but they're all optional named (except culture). Can you give this a try and see if this fixes things for you? |
That works ok for me |
@madhon The fix is in 21.0.5 on NuGet. https://www.nuget.org/packages/CsvHelper/21.0.5 |
@corykroll @EricZimmerman Are the updated docs sufficient? |
seems good to me. i think the confusion was having to init everything via the constructor, vs setting properties after. |
Great. It was made immutable to solve mutli treading issues. |
@JoshClose That worked for me! Thank you for the updated info, I really appreciate it. Sorry for the delay in response, got sidetracked there for a bit. |
This worked 100% for me. Thanks! |
I'm unable to find an example of how to change the delimiter when reading a file.
The following code no longer works since 20.0.0 since the Delimiter parameter is read-only:
csvReader.Configuration.Delimiter = "|";
If you look around the internet (Stack Overflow, etc.) this is always the way that it seems to be done. I can't seem to find an example or pattern on how to now accomplish this.
The text was updated successfully, but these errors were encountered: