I have a text file which contains user records.In the text file one user record is present in three lines of text file.Now as per my requirement i have to read first three lines for one User, Process it and insert into database and next three lines for second user and so on..
Here is the code that i have used for single line reading from text files..
if (System.IO.File.Exists(location) == true)
{
using (StreamReader reader = new StreamReader(location))
{
while ((line = reader.ReadLine()) != null)
{
line = line.Trim();
}
}
}
Please help me to read multi-lines , in this case 3 lines from text file ..
Thanks..