More details required... what are you trying to do?
Most apps have a 'find' - open the doc in texedit/whatever and hit cmd-F
Spotlight also indexes text in documents. cmd-space, then type the text you're looking for.
If you want to do something a lot more advanced, I'd be thinking about using 'grep' on the command line.