Need to sort a very large list of words

  • Thread starter Thread starter Frank
  • Start date Start date
F

Frank

I have a text file, one word per line.
I want to arrange the lines alphabetically so I opened it into MS Word and
asked Word to sort it.
Word said that the list was too big for it.
I figure I'll write a program to sort the file.
But I wonder if Word can't handle it what things I'll run into and what's
the best way to proceed.

I have no idea what kind of limits the are on array sizes and such.


Any helpful comments?


Thanks in advance.
 
Frank said:
I have a text file, one word per line.
I want to arrange the lines alphabetically so I opened it into MS Word and
asked Word to sort it.
Word said that the list was too big for it.
I figure I'll write a program to sort the file.
But I wonder if Word can't handle it what things I'll run into and what's
the best way to proceed.

I have no idea what kind of limits the are on array sizes and such.


Any helpful comments?


Thanks in advance.


Why not use the command line utility sort.exe?

Willy.
 
Frank said:
I have a text file, one word per line.
I want to arrange the lines alphabetically so I opened it into MS Word and
asked Word to sort it.
Word said that the list was too big for it.
I figure I'll write a program to sort the file.
But I wonder if Word can't handle it what things I'll run into and what's
the best way to proceed.

I have no idea what kind of limits the are on array sizes and such.


Any helpful comments?

Suggestion, first pigeonhole the data, by reading one line at a time, and
putting all the As in one file, Bs in another, etc, without worrying about
sorting. Then, sort each file independently, then catenate all the files
back together.
 
I'll bite... what does "too large" mean?

Is there some actual number of words you might let us in on? I don't mean
to sound silly but if it is gazillion you'd probably run into different
problems than if it was just .5 gazillion. Other than that are you sorting
it in realtime, once per hour, once per day, on demand, this one time and
then who cares?
 
Thanks, I think I'll try the suggestion from Willy then Ben if needed
 
Good idea, thanks
Ben Voigt said:
Suggestion, first pigeonhole the data, by reading one line at a time, and
putting all the As in one file, Bs in another, etc, without worrying about
sorting. Then, sort each file independently, then catenate all the files
back together.
 
I would create a table in SQL2005 Express and read each word line at a
time into the data table. Then pull out using ORDER BY clause and
write to output file.

Something like this gets even easier with a software like LLBLGenPro
(http://llblgen.com) I imagine this could all be done in a matter of 5
mins. or less :)
 
Sir C4 said:
I would create a table in SQL2005 Express and read each word line at a
time into the data table. Then pull out using ORDER BY clause and
write to output file.

Something like this gets even easier with a software like LLBLGenPro
(http://llblgen.com) I imagine this could all be done in a matter of 5
mins. or less :)


If you are familiar with it. I may try it just to learn about SQL

Thanks
 
Or he could lease time on Deep Blue. But why would he need an OR mapper to
sort a list of words?

I don't believe anybody knows why he wants to do it in which case an old
copy of FoxPro can sort them as could any number of free database tools.
The last thing on my list would have been Word, I didn't even know Word
could do such a thing. If I wanted MS Office to do it I might have given
Excel a shot at it. :-)
 
Thanks to all but the first reply about the command line sort utility worked
great.
If that didn't I sure the second reply would have been simple to program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top