Just read it first before you get into the loop. I’d do this:
using (StreamReader sr = new StreamReader(filePath))
{
string headerLine = sr.ReadLine();
string line;
while ((line = sr.ReadLine()) != null)
{
...
}
}
(I don’t like using Peek, personally.)
Then when you write out the output, start with headerLine
.