# Problem with deleting words from text [closed]

The task I need to do is to import a text book from here http://www.gutenberg.org/cache/epub/36/pg36.txt, then drop the last 20000 words from it and determine how many times the remaining words occur.

text = Drop[Import["http://www.gutenberg.org/cache/epub/36/pg36.txt", "Words"], -20000];

wordcounts = WordCounts[text];

top30 = Take[Transpose[{Keys@wordcounts, Values@wordcounts}], 30];
TableForm[top30, TableHeadings -> {None, {"Words", "Count"}}];


Why doesn't the above code work?

## closed as off-topic by m_goldberg, RunnyKine, ilian, MarcoB, user9660 Apr 3 '16 at 5:08

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – m_goldberg, RunnyKine, ilian, MarcoB, Community
If this question can be reworded to fit the rules in the help center, please edit the question.

• Look up Drop[]. – J. M. is away Apr 2 '16 at 16:32
• Will it work with words? Or is it just going to drop characters instead of words? Sorry I am asking, can't check it up right now. – cubus14 Apr 2 '16 at 16:36
• ...maybe you should show the code you already have, so that we aren't left guessing. – J. M. is away Apr 2 '16 at 16:50
• Drop[Import["http://www.gutenberg.org/cache/epub/36/pg36.txt", "Words"], -20000]? – kglr Apr 2 '16 at 17:20
• WordCounts takes a single string as it 1st argument. You have given it a list of words. Since you already have a list, use Counts. – m_goldberg Apr 3 '16 at 15:29

text = Drop[Import["http://www.gutenberg.org/cache/epub/36/pg36.txt", "Words"], -20000];