One way is to create a stringbuilder and use it to create the string. Then use
AppendAllText[
^] to create the file. For example:
StringBuilder sb = new StringBuilder();
sb.AppendFormat("{0}|{1}|{2}|{3}", "text 1", "text 2", "text 3", "text 4").AppendLine();
try {
System.IO.File.AppendAllText(@"C:\temp\test.csv", sb.ToString());
} catch (System.Exception ex) {
}