Results 1 to 9 of 9
  1. #1
    3 Star Lounger
    Join Date
    Feb 2001
    Posts
    262
    Thanks
    0
    Thanked 0 Times in 0 Posts

    sort large docs (Word 2000)

    I have a large document that I want to sort. Word won't do it and gives an error message. Is there any way I can sort a large document -- it's 2,000 pages with a single word on each line. Thanks!

  2. #2
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    New Zealand
    Posts
    295
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sort large docs (Word 2000)

    The only way I know is to convert the text into a table which can then be sorted. Table, Convert Text to Table. 1 Column. Then Table Sort. If necessary you could then convert back to text. <img src=/S/groovin.gif border=0 alt=groovin width=21 height=21>

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: sort large docs (Word 2000)

    Wait, that would be about 100,000 rows. I think Word would lock up and die if you tried to convert that to a table. What if you were to import it into an Access table, and then save or merge that back into a Word document? You'd lose any formatting...

  4. #4
    Platinum Lounger
    Join Date
    Dec 2000
    Location
    Queanbeyan, New South Wales, Australia
    Posts
    3,730
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: sort large docs (Word 2000)

    Actually, you can perform the "Table, sort" by highlighting all the text, and selecting the option. Even though it's under the "Table" menu, it does not need to be a table to sort it. So I suspect that if it's too large to sort just being text, it may well be too large to sort in a table.

    It may be small enough to copy into Excel and sort it, but I suspect not.

    A slow way of sorting it (If you didn't want to do it often) is to sort it in VBA. A bubble sort, though quite inefficient, is simple to code:

    Go through the document. Compare 2 lines. If the second is smaller than the first, swap them- and start again at the beginning of the document.
    Subway Belconnen- home of the Signboard to make you smile. Get (almost) daily updates- follow SubwayBelconnen on Twitter.

  5. #5
    ileacy
    Guest

    Re: sort large docs (Word 2000)

    Save the document as "Text Only with line Breaks" with eg. name "UNSORTED.TXT".

    Go to a DOS window.

    Change to the directory in which you saved the document.
    Type the command

    SORT <UNSORTED.TXT >SORTED.TXT

    Exit DOS.

    Import SORTED.TXT into a new WORD document.

  6. #6
    5 Star Lounger
    Join Date
    Jul 2003
    Location
    USA
    Posts
    728
    Thanks
    7
    Thanked 2 Times in 2 Posts

    Re: sort large docs (Word 2000)

    Hi -

    What's worked for me in similar situations is to select chunks of the text to be sorted (in your case, many pages, not all 2,000), sort, and when entire document has been "individually" sorted, try sorting the entire document.

    In othe words, try performing the sort in steps and then sort the sorts (the full document).

    Good luck.

  7. #7
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: sort large docs (Word 2000)

    This sounds like so much power I can hardly wait to try it. I'm sure I'll get my chance some day. <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    <pre>C:WINDOWS>sort /?
    Sorts input and writes results to the screen, a file, or another device

    SORT [/R] [/+n] [[drive1:][path1]filename1] [> [drive2:][path2]filename2]
    [command |] SORT [/R] [/+n] [> [drive2:][path2]filename2]

    /R Reverses the sort order; that is, sorts Z to A,
    then 9 to 0.
    /+n Sorts the file according to characters in
    column n.
    [drive1:][path1]filename1 Specifies file(s) to be sorted
    [drive2:][path2]filename2 Specifies a file where the sorted input is to be
    stored.
    command Specifies a command whose output is to be sorted.</pre>

    I wonder how it handles long lines? Hmmm...

  8. #8
    ileacy
    Guest

    Re: sort large docs (Word 2000)

    Hey, if you want power try <A target="_blank" HREF=http://www.funduc.com/ssmain1.htm>this</A>.

  9. #9
    ileacy
    Guest

    Re: sort large docs (Word 2000)

    Or <A target="_blank" HREF=http://www.chmaas.handshake.de/delphi/freeware/cmsort/cmsort.htm>this</A> if you want it for free.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •