Hi @gal mor ,
Since the data is read row by row, you can set two variables to count the number of rows of data added to each file.
string compId1 = "aa";
string compId2 = "bb";
Dictionary<string, int> dic = new Dictionary<string, int>();
dic.Add(compId1, 0);
dic.Add(compId2, 0);
dic[compId]++;//After readLine every time.
Best Regards.
Jiachen Li
----------
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.