Question by
donuan · Nov 14, 2015 at 10:17 PM ·
streamreader
StreamReader not reading the whole file
Hi!
I am trying to read a file with streamreader in unity 5, but it only reads 136 lines even though the file has 52116 lines.
Here is the code:
import System.IO;
var fileName = "fingerprint.txt";
function Start () {
var sr = new StreamReader(Application.dataPath + "/FingerPrintKeysRead/" + fileName);
var fileContents = sr.ReadToEnd();
sr.Close();
var lines = fileContents.Split("\n"[0]);
for (line in lines) {
print (line);
}
}
What am I doing wrong? Help would be much appriciated. Thanks!
(ps. each line contains a byte so maybe Streamreader is not the best way of doing it)
Comment
Your answer