in reply to Re: How can I read multiple lines starting with the same number and put in to a nested array and print it to a file?
in thread How can I read multiple lines starting with the same number and put in to a nested array and print it to a file?

As I said I have no trouble puting lines into an array and sorting them the way I want, my trouble is how I can read multiple lines starting with the same number and put only those into an array (sort it print it) and continue. In my example read the first line then all the lines starting with that number( happens to be number 1), put them into an array, sort it, open output file file print it, get all the lines starting with next number which is 4 in this example, put them into an array, sort it , open the output file print it, and do this till the end of file. I need an algorithm, I feel quite stupid, I should be able to work this out, but my brain is not working at the moment! I can put the entire file into an array, but I do not want to that, because of memory problems. Thanks a lot for all the responds.
  • Comment on Re: Re: How can I read multiple lines starting with the same number and put in to a nested array and print it to a file?