If you are doing a real project, then you need to decide how the file will get onto the target system. If you are going to include it in the code/data image the just arrange for it to a data block and access as an array.
You can convert a text/binary file to an object file using 'objcopy', I think you need:
objcopy -I binary -O nios2 -B nios2 mydata.txt mydata.o
You might want to add:
--rename-section .data=.rodata.mydata,alloc,load,readonly,data,contents
I use this to insert the code and data of by nios program into the data area of the ppc program that loads and interfaces with it. The ppc program is also linked with the symbol table of the nios program. This removes all the problems of mismatched versions!