For every possible variation in line format, you have to create a parsing strategy; so, anything you can do to control/simplify/regularize the format is valuable. Consider:
private char[] lnsplitchars = new char[] { '.', ' '};
private void btnParseLines_Click(object sender, EventArgs e)
{
foreach (string line in textBox1.Lines)
{
string[] lnsplit = line.Split(splitchars, StringSplitOptions.RemoveEmptyEntries);
int id = Int32.Parse(lnsplit[0]);
string text = lnsplit[1];
int ndups = 0;
if (lnsplit.Length == 3)
{
ndups = Int32.Parse(lnsplit[2]);
}
}
}
The real work begins with you formulating a clear strategy on transforming the parsed lines: you attempt that, and show your code.
Perhaps you will need to create an intermediate data structure ... like an Array of Arrays ... to hold the parsed line data; and/or use Linq 'GroupBy to organize duplicates.