Instantiate Objects from text file

So i have a text file that is

0:
PT:
7
X:
8
Y:
0
Z:
-4.5
RX:
-1.795997E-07
RY:
2.760271E-07
RZ:
2.96859E-09
Summon
1:
PT:
7
X:
18
Y:
-7.105427E-15
Z:
-4.5
RX:
-5.229958E-08
RY:
-1
RZ:
-8.977948E-07
Summon

when it’s paired with the script below they’re supposed to instantiate objects into a scene, every time “Summon” is read via streamreader, but non of the values get set for some reason X,Y,Z of the position and RX,RY,RZ to set the rotation of the object.

0:
PT:
7
X:
8
Y:
0
Z:
-4.5
RX:
-1.795997E-07
RY:
2.760271E-07
RZ:
2.96859E-09
Summon

This object is the first one to be loaded, It has prefab type 7, 8,0,-4.5 is the position. And -1.795997E-07, 2.760271E-07, 2.96859E-09 is the rotation. These values are then used to instantiate an object a specific position.

Here is the script

import System.IO;
 @header("GUI elements")
 var file : String;
 var InputText : UnityEngine.UI.InputField;
 @header ("Behind The Scenes")
 var CurrentLine : String;
 var Prefab1 : GameObject;
 var Prefab2 : GameObject;
 var Prefab3 : GameObject;
 var Prefab4 : GameObject;
 var Prefab5 : GameObject;
 var Prefab6 : GameObject;
 var Prefab7 : GameObject;
 var PrefabType : int = 0;
 var PosX : float = 0.0;	
 var PosY : float = 0.0;
 var PosZ : float = 0.0;
 var RotX : float = 0.0;
 var RotY : float = 0.0;
 var RotZ : float = 0.0;
 var PosXString : String = "X:";
 var PosYString : String = "Y:";
 var PosZString : String = "Z:";
 var RotXString : String = "RX:";
 var RotYString : String = "RY:";
 var RotZString : String = "RZ:";
 var PrefabTypeString : String = "PT:";
 var LoadSetting : int = 0;
 var SummonString : String = "Summon";
 var PosXSummon : float = 0.0;
 var PosYSummon : float = 0.0;
 var PosZSummon : float = 0.0;
 var RotXSummon : float = 0.0;
 var RotYSummon : float = 0.0;
 var RotZSummon : float = 0.0;
 var PrefabSummon : int = 0;


 function UpdateName () {
	 file = InputText.text;
 }
 function ReadFile(file : String){
   file = InputText.text;
    if(File.Exists(file + ".txt")){
        var sr = File.OpenText(file + ".txt");
        var line = sr.ReadLine();
        while(line != null){
			Debug.Log(line); // prints each line of the file
			//Add load scripting here.
			CurrentLine = line;
			if(LoadSetting == 1){
				int.TryParse(CurrentLine, PrefabType);
				PrefabSummon = PrefabType;
			}
			if(LoadSetting == 2){
				float.TryParse(CurrentLine, PosX);
				PosXSummon = PosX;
			}
			if(LoadSetting == 3){
				float.TryParse(CurrentLine, PosY);
				PosYSummon = PosY;
			}
			if(LoadSetting == 4){
				float.TryParse(CurrentLine, PosZ);
				PosZSummon = PosZ;
			}
			if(LoadSetting == 5){
				float.TryParse(CurrentLine, RotX);
				RotXSummon = RotX;
			}
			if(LoadSetting == 6){
				float.TryParse(CurrentLine, RotY);
				RotYSummon = RotY;
			}
			if(LoadSetting == 7){
				float.TryParse(CurrentLine, RotZ);
				RotZSummon = RotZ;
			}
			if (CurrentLine == PrefabTypeString){
				LoadSetting = 1;
			}
			if (CurrentLine == PosXString){
				LoadSetting = 2;
			}
			if (CurrentLine == PosYString){
				LoadSetting = 3;
			}
			if (CurrentLine == PosZString){
				LoadSetting = 4;
			}
			if (CurrentLine == RotXString){
				LoadSetting = 5;
			}
			if (CurrentLine == RotYString){
				LoadSetting = 6;
			}
			if (CurrentLine == RotZString){
				LoadSetting = 7;
			}
			if(CurrentLine == SummonString){
				
			}
            line = sr.ReadLine();
        }  
    } else {
        Debug.Log("Could not Open the file: " + file + " for reading.");
        return;
    }
}

I had a very similair system i was using to load levels. In your text file I wouldn’t separate your info by lines. I would separate by commas. this way you could use the commas in a Split function to quickly pack your numbers into an array for super easy reference. it would also make your numbers easily visable in the inspector to see where your problems are.
also you could quickly identify your peramiters by array number.

var txt:String;
var stringarray:String[];
var floatarray:float[];
var i:int;
var sr :StreamReader = new StreamReader("your path");                  
txt = sr.ReadToEnd();
sr.Close();

//make an array of string numbers from your text file
stringarray=txt.Split(","[0]);


//make another array of floats from the string;
floatarray=new float[stringarray.Length];
i=stringarray.Length;
while(i>0){i--;
float.TryParce(stringarray_,floatarray*);*_

}

in your text file there should be no need for anything but numbers and commas. if you write the numbers in the same order everytime your script should always know that floatarray[2] is always a y coordinate and so on. you wouldnt need all those variables you have. each “load” would just be a neat array. I hope this concept makes things easier for ya. i would just keep a little notebook by your keyboard to remember which numbers in the array are for what when your doing your spawning and stuff.
if your script is not parcing some of those floats correctly it is my guess the tryparce function doesnt like the “e”'s in your string. when you write your rotations and positions you could eliminate that by rounding some of the numbers to the nearest .001 like this:
var numbertowrite:float;
numbertowrite=Mathf.Round(transform.position.x1000).001;