If you have already worked out how you're going to scrape the data from the text file, then the plumbing of uploading a file and post-processing it will depend slightly on the technique that you use to accept the uploaded file and store it. I built something similar (years ago, my first commercial Rails job) that used Paperclip to upload a PDF, and a custom "thumbnail" processor to extract the plain text contents from the file after it was stored on disk. I doubt that the code would be helpful to you, as this was Rails 2.3, and everything has moved a long way from that point. But the key is to accept the file, store it to disk, then in an after_post_process (Paperclip custom life-cycle event) block, do your magic to the uploaded file.
To do this in stages, work through the Readme on
https://github.com/thoughtbot/paperclip and get your app to accept the uploaded file. Then read up on custom processors in the Paperclip wiki on Github. If your question is about text processing, then the previous comment about Regular Expressions is indeed where you need to look. I can recommend Mastering Regular Expressions (Friedl, from OReilly Publishing).
Walter