A scanner effectively takes a photograph of a document, typically resulting in a jpeg image (although, as TonyV has suggested, you can change that to pdf format). All that your scanner 'sees' is blocks of different colours, which make up the photograph. It can't 'see' letters or words, so it's impossible for it (working on its own) to produce a text file.
So, as CAC suggests, you need to use OCR ('optical character recognition') software to examine the 'photograph' and to try to work out which letters and words are on the page. Many all-in-one printers are supplied with suitable software but it will be installed on your computer, not on your scanner/printer itself. So you need to look through the list of programs on your computer (probably under the make of your printer) to see if there's an OCR one available. If there is then, obviously, that should be what you use.
Otherwise you can try a free OCR program such as FreeOCR
http://www.paperfile.net/
or an online conversion service such as this one:
https://www.onlineocr.net/