Freemarker doesn't natively include any mechanisms for reading data - being a pure templating language it expects the template to be passed all of the data that it needs in order to do its job (see http://freemarker.org/docs/dgui_quickstart_basics.html for background on why Freemarker was designed this way).
In the context of Alfresco Web Scripts, this means that any data that your Freemarker template requires must be provided by the controller of the Web Script (either the Javascript script or Java class, depending on how the Web Script was implemented).
So for the use case you describe, the text file would be retrieved by the Web Script controller (JS or Java) and its contents added to the special "model" variable as a new property, thereby making it available to the Freemarker template for further markup.