Can I suggest that you study the examples in the Teradata documentation: “UDF, UDM and External Stored Procedure Programming”? Look at appendix A in 12.0 or appendix B in 6.2 documentation. The examples are about as simple as one can get for table functions.
I'll give it a try once again, but I wasn't able to compile it (V2R6 example of table function) in first try...thats why asked for a simplest possible example which returns data from a table not from some sort of file.
I would start with the second example “Constant/Variable Mode Table Function”. It is sort of what you are looking for. It takes in a string from a table (or constant) and extracts fields out of it creating a row(s) with three columns for the information it extracted out of the string. That would be a typical usage. That one uses no external file as input.
Other than that, specific comments/questions as to why you can’t make it work would be helpful. Why could you not compile it? What error?