Jacob Carlborg Wrote: > If a header is specified, is it possible to iterate over the content as > an associative array, something like this: > > string str = "a,b,c\nHello,65,63.63\nWorld,123,3673.562"; > auto records = csvText(str, ["b"]); > > foreach (header, value ; records) {} > > Or accessing a value by header: > > foreach (record ; records) > { > auto value = record["a"]; > auto val = record.b; // perhaps using opDispatch as well > } > > -- > /Jacob Carlborg
If I implemented it this way then the entire record would be read in when a header exists. auto records = csvText!(string[string])(str, ["b"]); Would that be acceptable?