Help with reading a text file?

Why does this script not work? I am getting an error saying "Object reference not set to an instance of an object" reffering to the

var lineElements = lines[currLine]

section of the script. This is probably wrong in every way. But I tried my best to follow the help given to this question.

    if (rec.playing) {
    if (!readOnce) {
        var sr = new StreamReader("recording/Crash.txt");
        fileContents = sr.ReadToEnd();
        sr.Close();
        readOnce = true;
    }
    var lines = fileContents.Split("
"[0]);
    for (line in lines) {
        print (line);
    }
}
var lineElements = lines[currLine];
if (lineElements == rec.recTime) {
    currLine = (currLine+ 1);
    if (RideToggle<1) {
        audio.clip = Ride;
        audio.Play();
        RideToggle=1;
    } else {
        RideToggle=0;
    }
}

I have already written the writing part of this script and I have just got to finish this reading part. Any help will be massively thanked! As a side note how do you add a bounty to a question?

On request:

Script which contains the HUD: All that is important from this script is that it is named "rec" and it has 2 static variables called "recTime" "playing" and "recording" float, boolean, boolean respectively. Playing is true when playback is requested by user and same for recording. recTime is set to zero every time the user begins recording or playing back (then goes up with game time).

Script I want to playback with:

import System.IO; 
private var readOnce = false;
private var fileContents : String;
private var currLine = 0;
private var lineElements : float;
private var lines : String[];
var Ride : AudioClip;
var RideToggle=0;

function Update () {

    if (Input.GetButtonDown ("crashKey")) {
        if (rec.recording) {
            var crashSW = new StreamWriter("recording/Crash.txt",true);
            crashSW.WriteLine(rec.recTime + "
");
            crashSW.Close();
        }
        if (RideToggle<1) {
            audio.clip = Ride;
            audio.Play();
            RideToggle=1;
        } else {
            RideToggle=0;
        }
    }
    if (rec.playing) {
        if (!readOnce) {
            var sr = new StreamReader("recording/Crash.txt");
            fileContents = sr.ReadToEnd();
            sr.Close();
            readOnce = true;
        }
        lines = fileContents.Split("
"[0]);
        for (line in lines) {
            print (line);
        }
    }
    if (lines==null)return;
    lineElements = float.Parse(lines[currLine]);
    if (lineElements > rec.recTime) {
        currLine = (currLine+ 1);
        if (RideToggle<1) {
            audio.clip = Ride;
            audio.Play();
            RideToggle=1;
        } else {
            RideToggle=0;
        }
    }

}

You're assigning the split contents to a variable at a lower scope to the code below it - my guess is that you probably added the var in front of lines by accident, and that it's supposed to be declared higher up in the script, at the correct scope