Reading any file as text. (.elv file reads as empty)

I have an .elv file which holds a array of floats. I want to read this file and then use it with terrainData.SetHeights() since it takes an array of floats. My over all goal is taking the .elv files from a project made with a different engine and using the same terrain in my new unity project.

I’m having trouble reading the file though. I have put the .elv in the resources folder. changed the extension to .bytes. but when I try to read the text, its empty. I am working based on this.

import System.IO;
var mappath:String;
mappath=“C:/whateverfolder/inanotherfolder/”;
var info = new DirectoryInfo(mappath);
var biglist = info.GetFiles();
var firstinlist = biglist[0].ToString();
var read :StreamReader = new StreamReader(firstinlist);
var load :String;
load = read.ReadToEnd();
read.Close();

// the string variable called load now contain whatever was in the first text document the pc found. 

this script will read a text document that is in a folder. if you are building for flash or a webplayer…forget about it. firewalls just block it. i got this sort of code working for a stand alone player build. unity reads this sort of thing in only string format. you cant store/load in format other than string. so any data you store needs to be decoded manually with simple script string funtions like “Split” and “Parce”.

if you want write an array you would need to write it one by one into a string with a loop.
then when reading, figure out how to split the long string and repack it back into an array. which is actually not too difficult if you know string funtions.

i didnt test this code as is but its key paste parts from my working game. the first line seems to work well at the top of your script outside of function start. anyways just thought this would give you a direction for research.