Loading a text document without spaces

For my project I need to load a very large document.
The document does not have spaces between the characters, but it does have many lines. My problem comes from the line: lines = Regex.Split(text, string.Empty); This only seperates the characters by lines leading to a single long row of objects instead of a maze. How do I fix this?

 string text = System.IO.File.ReadAllText("map.txt");
	string[] lines = Regex.Split(text, string.Empty);
	int rows = lines.Length;
	string[][] levelBase = new string[rows][];
	for (int i = 0; i < lines.Length; i++)  {
		string[] stringsOfLine = Regex.Split(lines*, " ");*

_ levelBase = stringsOfLine;_
* }*
* string[][] jagged = levelBase;*

* for (int y = 0; y < jagged.Length; y++) {*
* for (int x = 0; x < jagged[0].Length; x++) {*
* Debug.Log(jagged[0].Length );*
* switch (jagged[y][x]){*
* case sfloor_valid:
Instantiate(floor_valid, new Vector3(x, -.2f, -y), Quaternion.identity);
_
break;_
case sfloor_obstacle:
Instantiate(floor_obstacle, new Vector3(x, 0, -y), Quaternion.identity);
_
break;_
case sfloor_oob:
Instantiate(floor_OutOfBounds, new Vector3(x, 0, -y), Quaternion.identity);
_
break;_
_
}_
_
}_
_
}_
_
}*_

I think you are going about this the hard way. You can do:

 string text = System.IO.File.ReadAllText("map.txt");
 string[] lines = lines = text.Split (new[] { '\r', '

’ }, System.StringSplitOptions.RemoveEmptyEntries);

As with your code above, you have an array of strings. I use this particular split methods since the result will work for both Mac/Unix and Windows line endings, and produce an array without any empty lines. You can access any specific character just like the jagged array you are trying to produce. For example, you can do:

Debug.Log(lines[2][2]);

…which will display the third character in the third line. If you really want a jagged character array, you can process ‘lines’ array produced in the previous step as follows:

char[][] data;
data = new char[lines.Length][];
for (int i = 0; i < lines.Length; i++) {
     data _= lines*.ToCharArray();*_

}