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
columns of "Char" type in dbf are trimmed (ltrim) of space. #201
Comments
How to implement this in nuget package please guide |
I think that authors can do. And May do in future updates.
i pulled, modified and built the dll
…On Mon, 4 Sep 2023 at 11:45 AM, grvhack ***@***.***> wrote:
How to implement this is nuget package please guide
—
Reply to this email directly, view it on GitHub
<#201 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANSHRDDEQCMEUPHLC5GNR63XYVWYTANCNFSM6AAAAAA2VBYSCM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Ok thnx replacing line 26 with: |
Looks like there are two separate issues here:
Instead of replacing the current behavior, I'm thinking of adding a couple of options to DbfDataReaderOptions that control the string trimming (e.g. don't trim, trim start, trim end, trim both) and a separate option to control the returning of nulls for empty strings. Would that work? |
That would be great indeed!
Thanks 🙏
…On Fri, 8 Sep 2023 at 7:20 PM, Chris Richards ***@***.***> wrote:
Looks like there are two separate issues here:
- string values that have whites space at the beginning are being
trimmed
- if the string is whitespace only an empty string is returned rather
than null
Instead of replacing the current behavior, I'm thinking of adding a couple
of options to DbfDataReaderOptions that control the string trimming (e.g.
don't trim, trim start, trim end, trim both) and a separate option to
control the returning of nulls for empty strings.
Would that work?
—
Reply to this email directly, view it on GitHub
<#201 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ANSHRDF7J45D45WEPSP452TXZMPDVANCNFSM6AAAAAA2VBYSCM>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Describe the bug
columns of "Char" type in dbf are trimmed (ltrim) of space.
To Reproduce
Steps to reproduce the behavior:
take a dbf with a "C" data type and add value in that column as " Hi there"
Read it using DbfTable dbfrecord
you will get the value of that column as "Hi There".
the string values are TRIMED.
Solution suggested:
following is LINE NO 26 in DbfValueString.cs
Value = value.Trim(NullChar,' ');
Can change it to
Value = value.Trim(NullChar,' ');
if(string.IsNullOrWhiteSpace(Value)
Value=null; // this is the behaviour when we use ODBC
The text was updated successfully, but these errors were encountered: