Yaseen Staggie

Yaseen Staggie

  • NA
  • 1
  • 1.1k

Reading from a textfile and writing to another textfile

Feb 18 2014 10:53 AM
 I have Data in Notepad that looks like this
and im writing it to an output file
01 some Data
02 some Data
02 some data
03 some data(End of client 1)
01 some data
02 some data
02 some data
02 some data
03 some data(End of client 2)
 
I wana count howmany times the value 02 appears and display it after  The end of each client
Im using this piece of code to count (
int count = File.ReadLines(@"C:\Exercises\gamenam.dat").Count(line => line.StartsWith("02"));)
I want to know how do you display it after the end of each client?
Can you maybe guide me how to this?
 

Answers (2)