Read a specific line in a text file with Javascript

I’m needing help to read a specific line with Javascript and this is a part of my code to try read the file:

`try{

        var sr: StreamReader = new StreamReader("./game_Data/Resources/SaveFile");
		var fileRead = sr.ReadToEnd();
		sr.Close();
	
	}

	catch (e){

		print("Error to read file!");

	}

	var lines: String[] = fileRead.Split('

'[0]);

	for(var line: String in lines){
		
		if(line.Trim() == "Night"){

			gameContinue = line.Substring(line.Length - 7);

		}

	}`

I solved my problem. Using this code:

try{

		var sr: StreamReader = new StreamReader(SaveFile);
		var fileReader = sr.ReadToEnd();

		var words: String[] = fileReader.Split("

"[0]);

		var word: String[] = words[1].Split("="[0]);

		sr.Close();
	
	}

	catch (e){

		print("Error to read file!");

	}

	var nightSave = word[1].Replace(" ", "");

	gameContinue = nightSave;
}