On Monday, 3 October 2022 at 18:02:51 UTC, Salih Dincer wrote:
On Sunday, 2 October 2022 at 19:48:52 UTC, mw wrote:
```
text.csvReader!Layout(["b","c","a"]); // Read only
these column
```
The intention is very clear: only read the selected columns
from the csv, and for any other fie
On Sunday, 2 October 2022 at 19:48:52 UTC, mw wrote:
```
text.csvReader!Layout(["b","c","a"]); // Read only
these column
```
The intention is very clear: only read the selected columns
from the csv, and for any other fields of class Layout, just
ignore (with the default D .init valu
On Sunday, 2 October 2022 at 21:18:43 UTC, mw wrote:
[snipping]
A CSV library should consider all the use cases, and allow
users to ignore certain fields.
In R, you have to force `NULL` for `colClasses` for the other
columns. In other words, the user has to know the number of
columns of the
On 10/2/22 23:18, mw via Digitalmars-d-learn wrote:
A CSV library should consider all the use cases, and allow users to ignore
certain fields.
Filed issue: https://issues.dlang.org/show_bug.cgi?id=23383
Let's see what others have to say.
On Sunday, 2 October 2022 at 21:03:40 UTC, rassoc wrote:
But say, I'm curious, what's the purpose of adding an
optional/useless contents field? What's the use-case here?
We have a class/struct for a data record,
some of its data fields need to be saved/loaded from CSV files;
while there are
On 10/2/22 21:48, mw via Digitalmars-d-learn wrote:
```
text.csvReader!Layout(["b","c","a"]); // Read only these column
```
The intention is very clear: only read the selected columns from the csv, and
for any other fields of class Layout, just ignore (with the default D .init
value)
```
text.csvReader!Layout(["b","c","a"]); // Read only these
column
```
The intention is very clear: only read the selected columns from
the csv, and for any other fields of class Layout, just ignore
(with the default D .init value).
Hi,
I'm following the example on
https://dlang.org/phobos/std_csv.html
```
class Layout
{
int value;
double other;
string name;
int extra_field; // un-comment to see the error
}
void main()
{
import std.csv;
import std.stdio: write, writeln,