here is the code i’m using
using (FileStream fs = new FileStream(filename, FileMode.Open))
using (StreamReader rdr = new StreamReader(fs))
{
while (!rdr.EndOfStream)
{
for (int z = 0; z < 2; z++)
{
string[] lines = rdr.ReadLine().Split('|');
{
sb.AppendLine(";Re");
sb.AppendLine("@C PAMT " + lines[3]);
sb.AppendLine("@T " + lines[0]);
sb.AppendLine("@D @I\\" + lines[1]).Replace("I:\\", "");
sb.AppendLine(lines[2].Replace(";", "\r\n");
}
}
}
}
using (FileStream fs = new FileStream(outputfilename, FileMode.Create))
using (StreamWriter writer = new StreamWriter(fs))
{
writer.Write(sb.ToString());
}
All i want is to either skip the first line of the StreamReader or skip the entire first stringbuilder. I thought the for would do it but it doesnt.
Note: i’d like to advoid a foreach.
Why not just read the first line and do nothing with it?
or if you don’t want to do that, have an outside variable i and test for i!=0