String compare, sort, regex split
Try this:

class Program
{
    static void Main(string[] args)
    {
        //var input = File.ReadAllText("input.txt");

        var input = "5 string one | 5.2 string two | 5.2.1 string three\r\n"+
                    "5 string four &gt;&gt; 5.6 string five &gt;&gt; string six\r\n" +
                    "1 string seven &gt;&gt; 1.1 string eight || 1.1.1 string nine\r\n";

        var matches = Regex.Matches(input, @"([0-9. ]*)(string \w*)([\|&gt; $]*)",
            RegexOptions.Multiline);
        var template = "Number[{0}] = {1}\r\n" +
                       "Name[{0}] = {2}\r\n" +
                       "Separator[{0}] = {3}\r\n";
        var sb = new StringBuilder();
        sb.AppendLine("MyClass");
        int counter = 0;
        foreach (Match item in matches)
        {
            sb.AppendLine(String.Format(template,
                counter++,
                item.Groups[1].ToString().Trim(),
                item.Groups[2].ToString().Trim(),
                item.Groups[3].ToString().Trim()));
        }
        Console.WriteLine(sb.ToString());
    }
}


The output is:

MyClass
Number[0] = 5
Name[0] = string one
Separator[0] = |

Number[1] = 5.2
Name[1] = string two
Separator[1] = |

Number[2] = 5.2.1
Name[2] = string three
Separator[2] =

Number[3] = 5
Name[3] = string four
Separator[3] = &gt;&gt;

Number[4] = 5.6
Name[4] = string five
Separator[4] = &gt;&gt;

Number[5] =
Name[5] = string six
Separator[5] =

Number[6] = 1
Name[6] = string seven
Separator[6] = &gt;&gt;

Number[7] = 1.1
Name[7] = string eight
Separator[7] = ||

Number[8] = 1.1.1
Name[8] = string nine
Separator[8] =


Based on the request in your comment, I'm adding ordering of the output. Just replace the foreach statement above  with the following lines and make sure you add a using System.Dynamic; to the top of your class file:

List&lt;dynamic&gt; items = new List&lt;dynamic&gt;();
foreach (Match match in matches)
{
    dynamic item = new ExpandoObject();
    item.Index = counter++;
    item.Number = match.Groups[1].ToString().Trim();
    item.Name = match.Groups[2].ToString().Trim();
    item.Separator = match.Groups[3].ToString().Trim();
    items.Add(item);
}

var sb = new StringBuilder();
sb.AppendLine("MyClass");
foreach (var item in items.OrderBy(i =&gt; i.Number))
{
    sb.AppendLine(String.Format(template,
    item.Index,
    item.Number,
    item.Name,
    item.Separator));
}