To add data, you'll do something like:
SLst := TStringList.Create;
SLst.Add('This is a string');
SLst.Add(VariableName);
SLst.Add(IntToStr(55));
SLst.Add(IntToStr(VariableName));
you'll define SLst by:
var
SLst: TStringList;
And if you want to load it from a textfile:
SLst.LoadFromFile('C:\myfile.txt');
And what do you mean by count the same data? You mean to count how much lines there are in the File? If yes, then:
Count := SLst.Count;
But if you want to show the data in a Memo, then do the following instead of all the above code:
Memo1.Lines.LoadFromFile('C:\myfile.txt');
Count := Memo1.Lines.Count;
I hope my answer helped.