How can I alphabetize sentences in word?

TechBoyJK

Lifer
Oct 17, 2002
16,699
60
91
Hi,

I have about 140 pages of statements and sentences compiled into a word document. These are mainly notes, ideas, thoughts, etc. I compiled it from several other documents I put together. I was wondering if there was a program or filter that would reorder these statements alphabetically starting with the first letter of the sentence. Anything like that around? I know i have duplicate statements all over this thing and I would rather not sort it by hand.

Thanks!

Jason
 

darktubbly

Senior member
Aug 19, 2002
595
0
0
Heh, here's what happens when you've had too much caffeine. This assumes you have MS Excel. Try it first on a small section of the text before doing all of it. Anyway, copy your text to notepad and save it as a plain text file.

1) Import it into Excel (Data->Import External Data), making sure to Delimit the text using (.) periods. After importing, each sentence should be in separate columns in the same row [Row A].
2) Cut the entire row, do a paste special on the row below it and make sure you click Transpose. You should now have multiple rows containing separate sentences.
3) To eliminate extra spaces in front of the sentence, add a new formula in cell B1 as follows: =TRIM(A1). Fill the formula down all the way through the rest of column B.
4) Data->Sort on column B.
5) Copy column B, go to Word, Paste Special->Unformatted text.

It's not perfect, but it'll get you off to a good start. There are several problems with this method, just one of which is that it assumes all sentences end with a period (fix this by adding another formula: =CONCATENATE(B1,".")),.

I bet someone will post a "Data->Sort paragraph alphabetically" 5 minutes after this post.
 

notfred

Lifer
Feb 12, 2001
38,241
4
0
perl, where '$doc' is your input file, and sentances are ended with periods:
$doc = join ".\n", (sort {uc($a) cmp uc($b)} (split /\s*\.\s*/, $doc));