Re: trouble with associative Arrays

2024-01-20 Thread Renato via Digitalmars-d-learn
On Saturday, 20 January 2024 at 15:16:00 UTC, atzensepp wrote: The section looks now simpler although I guess that there are more appropriate mechanisms available (csvreader): string [] orgids[string]; foreach (line; range) { if (!line.empty) { auto row =

Re: trouble with associative Arrays

2024-01-20 Thread atzensepp via Digitalmars-d-learn
Thank you T for your hint. This worked perfectly On Saturday, 20 January 2024 at 14:44:49 UTC, H. S. Teoh wrote: Because .byLine reuses its line buffer. You want .byLineCopy instead. The section looks now simpler although I guess that there are more appropriate mechanisms available (csvreader

Re: trouble with associative Arrays

2024-01-20 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Jan 20, 2024 at 02:33:24PM +, atzensepp via Digitalmars-d-learn wrote: > Hello, > > I am new with D and want to convert a c program for a csv file manipulation > with exhaustive dynamic memory mechanics to D . > > When reading a CSV-file line by line I would like to create an associa

trouble with associative Arrays

2024-01-20 Thread atzensepp via Digitalmars-d-learn
Hello, I am new with D and want to convert a c program for a csv file manipulation with exhaustive dynamic memory mechanics to D . When reading a CSV-file line by line I would like to create an associative array to get the row values by the value in the second column. Although I save the row