-
Notifications
You must be signed in to change notification settings - Fork 441
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
Add ability to detect NULL values #120
Comments
You can do this:
CSVReader<3, trim_chars<>, double_quote_escape<',', '\"'>> csv(file);
char* col1, *col2, *col3;
sv.read_row(col1, col2, col3);
if (*col1 == 0) { ... } else { int val = atoi(col1); ... }
Best Regards
Dr. Ben Strasser
…On 2021-05-12 15:14, lubomirmatus wrote:
The lib now does not have ability to detect that some value in row is
NULL.
col1, col2, col3
0,0,0
0,0,
0,,0
,0,0
When reading numeric rows
CSVReader<3, trim_chars<>, double_quote_escape<',', '\"'>> csv(file);
int col1, col2, col3;
csv.read_row(col1, col2, col3);
the columns with missing values are returned as 0, so we cannot
determine wheather it is real 0 or NULL.
Possible proposal is to use some kind of "nullable" wrapping type.
CSVReader<3, trim_chars<>, double_quote_escape<',', '\"'>> csv(file);
Nullable<int> col1, col2, col3;
csv.read_row(col1, col2, col3);
if (col1.is_null()) { ... }
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub [1], or unsubscribe
[2].
Links:
------
[1] #120
[2]
https://github.com/notifications/unsubscribe-auth/AC3IBD2YGTV6L6MZFAZLH5DTNJ5LVANCNFSM44YST5NA
|
Thank you for your fast response. |
There are two problems with NULLs:
All of these are problems that are circumvented in a do-it-yourself model. The simple cases that cover 99% get a pretty interface. Everything else needs to go via |
The lib now does not have ability to detect that some value in row is NULL.
When reading numeric rows
the columns with missing values are returned as 0, so we cannot determine wheather it is real 0 or NULL.
Possible proposal is to use some kind of "nullable" wrapping type.
The text was updated successfully, but these errors were encountered: