in reply to statistics of a large text

Please tell me how can I make it more efficient and faster to deal with large data. also is it possible to store it more efficient in a less space consuming method to be retrieved faster.
Be careful in what you want to optimize. You're asking to optimize storing of data. But that's usually the wrong question to ask - it's far more important to optimize your queries. After all, the fastest way to store your input file is to just copy it.

Determine what kinds of queries you need to do, and use that to determine what kind of datastructure you need.