Nice way to display 'snapshot' of uploaded long document


I am allowing users to submit large documents (book manuscripts) which will then go through a processing pipeline. When the user completes the file upload, it is then converted to txt format. I would then like to display a success message that gives some sort of 10-line snapshot of the document, kind of like “head” for pandas. Any ideas?