Re: How to efficiently resolve Associative Arrays not being sorted?

2020-06-02 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/2/20 3:32 AM, BoQsc wrote: I want to read a file, put it into an array, make some search and replace on the content and output the modified text. However Associative Arrays seem to be unsorted by default. Should I drop the Associative Arrays and use something else? What are the ways to

Re: How to efficiently resolve Associative Arrays not being sorted?

2020-06-02 Thread Ali Çehreli via Digitalmars-d-learn
On 6/2/20 12:32 AM, BoQsc wrote: > I want to read a file, put it into an array, make some search and > replace on the content and output the modified text. How large is the data? If it fits into memory, just read the whole thing, update it, sort the keys, and then output like this: import

Re: How to efficiently resolve Associative Arrays not being sorted?

2020-06-02 Thread Luis via Digitalmars-d-learn
On Tuesday, 2 June 2020 at 07:32:56 UTC, BoQsc wrote: I want to read a file, put it into an array, make some search and replace on the content and output the modified text. However Associative Arrays seem to be unsorted by default. Should I drop the Associative Arrays and use something else?

How to efficiently resolve Associative Arrays not being sorted?

2020-06-02 Thread BoQsc via Digitalmars-d-learn
I want to read a file, put it into an array, make some search and replace on the content and output the modified text. However Associative Arrays seem to be unsorted by default. Should I drop the Associative Arrays and use something else? What are the ways to resolve this randomness in