Skip to main content

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);
    }
}

This code is working fine for me to read the content in the text file

import System.IO;

var filename="data.txt";

function Start () {
    var sourse=new StreamReader(Application.dataPath+"/" + filename);
    var fileContents=sourse.ReadToEnd();
    sourse.Close();
    var lines=fileContents.Split("\n"[0]);
    for(line in lines) {
        print(line);
    }
}

This code is working fine for me to read the content in the text file

import System.IO;

var filename = "data.txt";

function Start () {
    var source = new StreamReader(Application.dataPath + "/" + filename);
    var fileContents = source.ReadToEnd();
    source.Close();
    var lines = fileContents.Split("\n"[0]);
    for(line in lines) {
        print(line);
    }
}

This code is working fine for me to read the content in the text file

import System.IO; 

var filename="data.txt";

function Start () {
    var sourse=new StreamReader(Application.dataPath+"/" + filename);
    var fileContents=sourse.ReadToEnd();
    sourse.Close();
    var lines=fileContents.Split("\n"[0]);
    for(line in lines) {
        print(line);
    }
}

var filename="data.txt";

function Start () { var sourse=new StreamReader(Application.dataPath+"/" + filename); var fileContents=sourse.ReadToEnd(); sourse.Close(); var lines=fileContents.Split("\n"[0]); for(line in lines) { print(line); } }

This code is working fine for me to read the content in the text file

import System.IO;

var filename="data.txt";

function Start () { var sourse=new StreamReader(Application.dataPath+"/" + filename); var fileContents=sourse.ReadToEnd(); sourse.Close(); var lines=fileContents.Split("\n"[0]); for(line in lines) { print(line); } }

This code is working fine for me to read the content in the text file

import System.IO; 

var filename="data.txt";

function Start () {
    var sourse=new StreamReader(Application.dataPath+"/" + filename);
    var fileContents=sourse.ReadToEnd();
    sourse.Close();
    var lines=fileContents.Split("\n"[0]);
    for(line in lines) {
        print(line);
    }
}
Source Link
user1509674
  • 807
  • 1
  • 20
  • 45

This code is working fine for me to read the content in the text file

import System.IO;

var filename="data.txt";

function Start () { var sourse=new StreamReader(Application.dataPath+"/" + filename); var fileContents=sourse.ReadToEnd(); sourse.Close(); var lines=fileContents.Split("\n"[0]); for(line in lines) { print(line); } }