I didn't optimize the code, but it should look like
var text = new StringBuilder("AnimalAge;Dog:20,Cat:10,Rat:5#\r\nAnimalType;Whale:Mammal,Crocodile:Reptile#\r\n");
var cat = text.ToString().Split(new[] { "#\r\n" }, StringSplitOptions.RemoveEmptyEntries)
.Select(x => x.Split(new[] { ";" }, StringSplitOptions.None))
.Select(x => new
{
Category = x[0],
Values = x[1].Split(new[] { "," }, StringSplitOptions.None)
})
.Select(x => new
{
Category = x.Category,
Values = x.Values.ToDictionary(y => y.Split(new[] { ":" }, StringSplitOptions.None)[0], y => y.Split(new[] { ":" }, StringSplitOptions.None)[1])
})
.ToList();
In the end you will get a list of Category/Values object, where Values is a Dictionary