You will have a difficult time with this project as you have it planned. First, I don't think Excel is the best choice for you to store the results. If you have that much data you will exceed the 65000 row limit in Excel 97 and if you used Excel 2007 format the file will be very slow to process. Second, the term line is a difficult one to define as RTF does not have a character limit for its paragraphs. so at best you can capture the number of the paragraph the "keyword" is located in. Unless you can force each "line" to be 80 characters in mono-spaced font.
It is best to "Ask" for help by showing us what you have attempted already along with a sample of the data you plan to process. Best of luck learning Perl as it is a wonderful language to use. All of what you need to do this project can be found here at the monastery if you know where to look for it.