This code is working fine for me to read the content in the text file
import System.IO;
var filename="datafilename = "data.txt";
function Start () {
var sourse=newsource = new StreamReader(Application.dataPath+"dataPath + "/" + filename);
var fileContents=soursefileContents = source.ReadToEnd();
soursesource.Close();
var lines=fileContentslines = fileContents.Split("\n"[0]);
for(line in lines) {
print(line);
}
}